Lines Matching refs:lang_id
17 #include "lang_id/lang-id.h"
30 namespace lang_id {
45 std::unique_ptr<LangId> lang_id(CreateLanguageDetector());
47 EXPECT_EQ("en", lang_id->FindLanguage("This text is written in English."));
49 lang_id->FindLanguage("This text is written in English. "));
51 lang_id->FindLanguage(" This text is written in English. "));
52 EXPECT_EQ("fr", lang_id->FindLanguage("Vive la France! Vive la France!"));
53 EXPECT_EQ("ro", lang_id->FindLanguage("Sunt foarte foarte foarte fericit!"));
59 std::unique_ptr<LangId> lang_id(CreateLanguageDetector());
65 lang_id->SetDefaultLanguage(kDefaultLanguage);
69 EXPECT_EQ(kDefaultLanguage, lang_id->FindLanguage("y"));
70 EXPECT_EQ(kDefaultLanguage, lang_id->FindLanguage("j"));
71 EXPECT_EQ(kDefaultLanguage, lang_id->FindLanguage("l"));
72 EXPECT_EQ(kDefaultLanguage, lang_id->FindLanguage("w"));
73 EXPECT_EQ(kDefaultLanguage, lang_id->FindLanguage("z"));
74 EXPECT_EQ(kDefaultLanguage, lang_id->FindLanguage("zulu"));
79 languages = lang_id->FindLanguages("y");
84 languages = lang_id->FindLanguages("Todoist");
91 lang_id->SetDefaultLanguage(kJapanese);
92 EXPECT_EQ(kJapanese, lang_id->FindLanguage("y"));
93 EXPECT_EQ(kJapanese, lang_id->FindLanguage("j"));
94 EXPECT_EQ(kJapanese, lang_id->FindLanguage("l"));
95 languages = lang_id->FindLanguages("y");
109 lang_id->SetDefaultLanguage(kDefaultLanguage);
110 EXPECT_EQ(kDefaultLanguage, lang_id->FindLanguage(still_small_string));
111 languages = lang_id->FindLanguages(still_small_string);
129 std::unique_ptr<LangId> lang_id(CreateLanguageDetector());
131 lang_id->SetDefaultLanguage(default_language);
137 const std::string predicted_language = lang_id->FindLanguage(gibberish);
151 } // namespace lang_id