use of com.yahoo.language.simple.SimpleLinguistics in project vespa by vespa-engine.
the class MinimalQueryInserterTestCase method setUp.
@Before
public void setUp() throws Exception {
searchChain = new Chain<>(new MinimalQueryInserter());
context = Execution.Context.createContextStub(null, null, new SimpleLinguistics());
execution = new Execution(searchChain, context);
}
use of com.yahoo.language.simple.SimpleLinguistics in project vespa by vespa-engine.
the class NormalizeTestCase method requireThatHashCodeAndEqualsAreImplemented.
@Test
public void requireThatHashCodeAndEqualsAreImplemented() {
Linguistics linguistics = new SimpleLinguistics();
NormalizeExpression exp = new NormalizeExpression(linguistics);
assertFalse(exp.equals(new Object()));
assertFalse(exp.equals(new NormalizeExpression(Mockito.mock(Linguistics.class))));
assertEquals(exp, new NormalizeExpression(linguistics));
assertEquals(exp.hashCode(), new NormalizeExpression(linguistics).hashCode());
}
use of com.yahoo.language.simple.SimpleLinguistics in project vespa by vespa-engine.
the class NormalizeTestCase method requireThatAccessorsWork.
@Test
public void requireThatAccessorsWork() {
Linguistics linguistics = new SimpleLinguistics();
NormalizeExpression exp = new NormalizeExpression(linguistics);
assertSame(linguistics, exp.getLinguistics());
}
use of com.yahoo.language.simple.SimpleLinguistics in project vespa by vespa-engine.
the class NormalizeTestCase method requireThatExpressionCanBeVerified.
@Test
public void requireThatExpressionCanBeVerified() {
Expression exp = new NormalizeExpression(new SimpleLinguistics());
assertVerify(DataType.STRING, exp, DataType.STRING);
assertVerifyThrows(null, exp, "Expected string input, got null.");
assertVerifyThrows(DataType.INT, exp, "Expected string input, got int.");
}
use of com.yahoo.language.simple.SimpleLinguistics in project vespa by vespa-engine.
the class TokenizeTestCase method requireThatHashCodeAndEqualsAreImplemented.
@Test
public void requireThatHashCodeAndEqualsAreImplemented() {
AnnotatorConfig config = new AnnotatorConfig().setLanguage(Language.ARABIC);
Expression exp = new TokenizeExpression(new SimpleLinguistics(), config);
assertFalse(exp.equals(new Object()));
assertFalse(exp.equals(new TokenizeExpression(Mockito.mock(Linguistics.class), new AnnotatorConfig().setLanguage(Language.SPANISH))));
assertFalse(exp.equals(new TokenizeExpression(new SimpleLinguistics(), new AnnotatorConfig().setLanguage(Language.SPANISH))));
assertEquals(exp, new TokenizeExpression(new SimpleLinguistics(), config));
assertEquals(exp.hashCode(), new TokenizeExpression(new SimpleLinguistics(), config).hashCode());
}
Aggregations