Lines Matching refs:model
48 std::unique_ptr<TextClassificationModel> model( in TEST() local
52 EXPECT_EQ(model->SuggestSelection( in TEST()
58 EXPECT_EQ(model->SuggestSelection("350 Third Street, Cambridge", {0, 27}), in TEST()
62 EXPECT_EQ(std::make_pair(0, 1), model->SuggestSelection("a", {0, 1})); in TEST()
65 EXPECT_EQ(std::make_pair(0, 4), model->SuggestSelection("asdf", {0, 4})); in TEST()
71 std::unique_ptr<TextClassificationModel> model( in TEST() local
76 model->SuggestSelection("350 Third Street, Cambridge", {0, 3})); in TEST()
78 model->SuggestSelection("350 Third Street, Cambridge", {4, 9})); in TEST()
80 model->SuggestSelection("350 Third Street, Cambridge", {10, 16})); in TEST()
82 model->SuggestSelection("a\nb\nc\n350 Third Street, Cambridge", in TEST()
89 std::unique_ptr<TextClassificationModel> model( in TEST() local
94 selection = model->SuggestSelection("abc\nBarack Obama", {4, 10}); in TEST()
98 selection = model->SuggestSelection("Barack Obama\nabc", {0, 6}); in TEST()
106 std::unique_ptr<TextClassificationModel> model( in TEST() local
113 selection = model->SuggestSelection( in TEST()
119 selection = model->SuggestSelection( in TEST()
125 selection = model->SuggestSelection( in TEST()
131 selection = model->SuggestSelection( in TEST()
154 std::unique_ptr<TestingTextClassificationModel> model( in TEST() local
159 model->StripPunctuation({0, 10}, ".,-abcd.()")); in TEST()
160 EXPECT_EQ(std::make_pair(0, 6), model->StripPunctuation({0, 6}, "(abcd)")); in TEST()
161 EXPECT_EQ(std::make_pair(1, 5), model->StripPunctuation({0, 6}, "[abcd]")); in TEST()
162 EXPECT_EQ(std::make_pair(1, 5), model->StripPunctuation({0, 6}, "{abcd}")); in TEST()
165 EXPECT_EQ(std::make_pair(0, 0), model->StripPunctuation({0, 1}, "&")); in TEST()
166 EXPECT_EQ(std::make_pair(0, 0), model->StripPunctuation({0, 4}, "&-,}")); in TEST()
169 EXPECT_EQ(std::make_pair(-1, 523), model->StripPunctuation({-1, 523}, "a")); in TEST()
170 EXPECT_EQ(std::make_pair(-1, -1), model->StripPunctuation({-1, -1}, "a")); in TEST()
171 EXPECT_EQ(std::make_pair(0, -1), model->StripPunctuation({0, -1}, "a")); in TEST()
235 std::unique_ptr<TestingTextClassificationModel> model( in TEST() local
239 model->DisableClassificationHints(); in TEST()
241 FindBestResult(model->ClassifyText( in TEST()
244 FindBestResult(model->ClassifyText("you@android.com", {0, 15}))); in TEST()
245 EXPECT_EQ("other", FindBestResult(model->ClassifyText( in TEST()
247 EXPECT_EQ("phone", FindBestResult(model->ClassifyText( in TEST()
249 EXPECT_EQ("other", FindBestResult(model->ClassifyText( in TEST()
254 FindBestResult(model->ClassifyText( in TEST()
259 FindBestResult(model->ClassifyText( in TEST()
264 FindBestResult(model->ClassifyText( in TEST()
270 EXPECT_EQ("other", FindBestResult(model->ClassifyText("obama", {0, 5}))); in TEST()
271 EXPECT_EQ("other", FindBestResult(model->ClassifyText("asdf", {0, 4}))); in TEST()
273 FindBestResult(model->ClassifyText("asdf", {0, 0}))); in TEST()
277 FindBestResult(model->ClassifyText("", {0, 0}))); in TEST()
278 EXPECT_EQ("<INVALID RESULTS>", FindBestResult(model->ClassifyText( in TEST()
285 std::unique_ptr<TestingTextClassificationModel> model( in TEST() local
291 FindBestResult(model->ClassifyText( in TEST()
295 FindBestResult(model->ClassifyText( in TEST()
299 EXPECT_EQ("url", FindBestResult(model->ClassifyText( in TEST()
306 model->DisableClassificationHints(); in TEST()
307 EXPECT_EQ(model->ClassifyText("x", {0, 1}, 0), in TEST()
308 model->ClassifyText("x", {0, 1}, in TEST()
311 EXPECT_EQ(model->ClassifyText("x", {0, 1}, 0), in TEST()
312 model->ClassifyText("x", {0, 1}, in TEST()
319 std::unique_ptr<TestingTextClassificationModel> model( in TEST() local
323 EXPECT_EQ("phone", FindBestResult(model->ClassifyText("phone: (123) 456 789", in TEST()
325 EXPECT_EQ("phone", FindBestResult(model->ClassifyText( in TEST()
327 EXPECT_EQ("other", FindBestResult(model->ClassifyText( in TEST()