gt-tools 0.1.4 → 0.1.4.1
raw patch · 4 files changed
+10/−10 lines, 4 files
Files
- Gt/Core.hs +5/−5
- Gt/Helpers.hs +2/−2
- Gt/Net.hs +2/−2
- gt-tools.cabal +1/−1
Gt/Core.hs view
@@ -19,7 +19,7 @@ return $ show $ jresp_to_resp jresp do_trans_each_word :: IO String-do_trans_each_word = undefined+do_trans_each_word = error "Gt.Core.do_trans_each_word: unimplemented" jresp_to_resp :: String -> Resp jresp_to_resp jobj = foldr fill_resp br obj_list@@ -37,7 +37,7 @@ -- Sentences processing jval_to_sentences :: JSValue -> Sentences jval_to_sentences (JSArray jval) = Sentences { sent_list = foldr jsso_to_sentence [] jval }-jval_to_sentences _ = undefined+jval_to_sentences _ = error "Gt.Core.jval_to_sentences: not a JSArray" jsso_to_sentence :: JSValue -> [Sentence] -> [Sentence] jsso_to_sentence (JSObject jobj) acc =@@ -46,7 +46,7 @@ -- so just leaving as is foldr tot (Sentence "" "" "") in_list:acc where in_list = fromJSObject jobj-jsso_to_sentence _ _ = undefined+jsso_to_sentence _ _ = error "Gt.Core.jsso_to_sentence: not a JSObject" -- Conversion of inner list with trans-orig-translit data tot :: (String, JSValue) -> Sentence -> Sentence@@ -60,7 +60,7 @@ -- Dictionaries processing jval_to_dicts :: JSValue -> Dicts jval_to_dicts (JSArray jval) = Dicts { dict_list = foldr jsdo_to_dict [] jval }-jval_to_dicts _ = undefined+jval_to_dicts _ = error "Gt.Core.jval_to_dicts: not a JSArray" jsdo_to_dict :: JSValue -> [Dict] -> [Dict] jsdo_to_dict (JSObject jobj) acc =@@ -69,7 +69,7 @@ -- so just leaving as is foldr pt (Dict "" []) in_list:acc where in_list = fromJSObject jobj-jsdo_to_dict _ _ = undefined+jsdo_to_dict _ _ = error "Gt.Core.jsdo_to_dict: not a JSObject" -- Conversion of inner list with pos-term data pt :: (String, JSValue) -> Dict -> Dict
Gt/Helpers.hs view
@@ -39,7 +39,7 @@ -- JSON deconstruct helpers from_ok :: Result a -> a from_ok (Ok x) = x-from_ok (Error _) = undefined+from_ok (Error e) = error $ "Gt.Helpers.from_ok: " ++ show e jarr_to_list :: JSValue -> [JSValue] jarr_to_list (JSArray jarr) = jarr@@ -51,4 +51,4 @@ jlist_to_slist :: JSValue -> [String] jlist_to_slist (JSArray xs) = map jstr_to_str xs-jlist_to_slist _ = undefined+jlist_to_slist _ = error "Gt.Helpers.jlist_to_slist: not a JSArray"
Gt/Net.hs view
@@ -16,7 +16,7 @@ trans_url :: Lang -> Lang -> String -> String trans_url sl tl text = exportURL $ foldl add_param base_url [("text", text), ("sl", sl), ("tl", tl)]- where base_url = fromJust $ importURL "http://translate.google.com/translate_a/t?client=t&pc=0&oc=1&hl=en&ie=UTF-8&oe=UTF-8"+ where base_url = fromJust $ importURL "http://translate.google.com/translate_a/t?client=j&pc=0&oc=1&hl=en&ie=UTF-8&oe=UTF-8" get_resp :: Lang -> Lang -> String -> IO String get_resp sl tl str =@@ -24,4 +24,4 @@ return $ decodeString result get_resp_each_word :: Lang -> Lang -> String -> IO String-get_resp_each_word = undefined+get_resp_each_word = error "Gt.Net.get_resp_each_word: undefined"
gt-tools.cabal view
@@ -1,5 +1,5 @@ name: gt-tools-version: 0.1.4+version: 0.1.4.1 cabal-version: >= 1.8 build-type: Simple license: GPL