summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2021-03-26 15:59:51 +0100
committerGitHub <noreply@github.com>2021-03-26 15:59:51 +0100
commitbddc4971f0ffc6a9ccd3d6ab57a701abc249673d (patch)
tree96c2896874fbd8af1e9c3a8af6057b72a47d12ba /container-search
parentcfc7927446dcea526fbdce38b8578c14671e1d6c (diff)
parent487b7df266d74511d30aa048988c9f89995d97ac (diff)
Merge pull request #17191 from vespa-engine/bratseth/carry-weight
Bratseth/carry weight
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/semantics/engine/Evaluation.java59
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/semantics/engine/Match.java32
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java14
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/semantics/rule/LiteralPhraseProduction.java18
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/semantics/rule/LiteralTermProduction.java21
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/semantics/rule/Production.java2
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/semantics/rule/ReferenceTermProduction.java34
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/semantics/rule/TermProduction.java18
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/semantics/test/RuleBaseAbstractTestCase.java4
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/semantics/test/SemanticSearcherTestCase.java5
-rw-r--r--container-search/src/test/java/com/yahoo/prelude/semantics/test/WeightingTestCase.java12
11 files changed, 113 insertions, 106 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/semantics/engine/Evaluation.java b/container-search/src/main/java/com/yahoo/prelude/semantics/engine/Evaluation.java
index b1b317379ff..07342a48916 100644
--- a/container-search/src/main/java/com/yahoo/prelude/semantics/engine/Evaluation.java
+++ b/container-search/src/main/java/com/yahoo/prelude/semantics/engine/Evaluation.java
@@ -246,13 +246,12 @@ public class Evaluation {
public void insertItem(Item item, CompositeItem parent, int index, TermType desiredParentType) {
if (parent == null) { // TODO: Accommodate for termtype in this case too
query.getModel().getQueryTree().setRoot(item);
-
return;
}
if (parent.getItemCount()>0 && parent instanceof QueryTree && parent.getItem(0) instanceof CompositeItem) {
// combine with the existing root instead
- parent=(CompositeItem)parent.getItem(0);
+ parent = (CompositeItem)parent.getItem(0);
if (index == 1) { // that means adding it after the existing root
index = parent.getItemCount();
}
@@ -260,7 +259,7 @@ public class Evaluation {
if (( desiredParentType == TermType.DEFAULT || desiredParentType.hasItemClass(parent.getClass()) )
&& equalIndexNameIfParentIsPhrase(item, parent)) {
- addItem(parent,index,item,desiredParentType);
+ addItem(parent, index, item, desiredParentType);
}
else {
insertIncompatibleItem(item, parent, query, desiredParentType);
@@ -273,27 +272,27 @@ public class Evaluation {
parent.setItem(0, item);
}
else if (index<=1 && !(parent.getItem(0) instanceof CompositeItem)) { // Case 2: The positive must become a composite
- CompositeItem positiveComposite=(CompositeItem)desiredParentType.createItemClass();
+ CompositeItem positiveComposite = (CompositeItem)desiredParentType.createItemClass();
positiveComposite.addItem(parent.getItem(0));
- positiveComposite.addItem(index,item);
- parent.setItem(0,positiveComposite);
+ positiveComposite.addItem(index, item);
+ parent.setItem(0, positiveComposite);
}
else if (parent.getItem(0)!=null && parent.getItem(0) instanceof CompositeItem // Case 3: Add to the positive composite
- && index<=((CompositeItem)parent.getItem(0)).getItemCount()) {
- ((CompositeItem)parent.getItem(0)).addItem(index,item);
+ && index <= ((CompositeItem)parent.getItem(0)).getItemCount()) {
+ ((CompositeItem)parent.getItem(0)).addItem(index, item);
}
else { // Case 4: Add negative
- parent.addItem(index,item);
+ parent.addItem(index, item);
}
}
- else if (parent.getItemCount()>0 && parent instanceof QueryTree) {
- CompositeItem composite=(CompositeItem)desiredParentType.createItemClass();
+ else if (parent.getItemCount() > 0 && parent instanceof QueryTree) {
+ CompositeItem composite = (CompositeItem)desiredParentType.createItemClass();
composite.addItem(parent.getItem(0));
- composite.addItem(index,item);
- parent.setItem(0,composite);
+ composite.addItem(index, item);
+ parent.setItem(0, composite);
}
else {
- parent.addItem(index,item);
+ parent.addItem(index, item);
}
}
@@ -305,32 +304,32 @@ public class Evaluation {
return ((PhraseItem)parent).getIndexName().equals(((IndexedItem)item).getIndexName());
}
- private void insertIncompatibleItem(Item item,CompositeItem parent,Query query,TermType desiredParentType) {
+ private void insertIncompatibleItem(Item item, CompositeItem parent, Query query, TermType desiredParentType) {
// Create new parent
CompositeItem newParent;
- if (desiredParentType==TermType.DEFAULT)
- newParent=new AndItem();
+ if (desiredParentType == TermType.DEFAULT)
+ newParent = new AndItem();
else
- newParent=(CompositeItem)desiredParentType.createItemClass();
+ newParent = (CompositeItem)desiredParentType.createItemClass();
// Save previous parent parent
- CompositeItem parentsParent=parent.getParent();
+ CompositeItem parentsParent = parent.getParent();
// Add items to new parent
newParent.addItem(parent);
newParent.addItem(item);
// Insert new parent as root or child of old parents parent
- if (parentsParent==null) {
+ if (parentsParent == null) {
query.getModel().getQueryTree().setRoot(newParent);
}
else {
- int parentIndex=0;
- if (parentsParent!=null) {
- parentIndex=parentsParent.getItemIndex(parent);
+ int parentIndex = 0;
+ if (parentsParent != null) {
+ parentIndex = parentsParent.getItemIndex(parent);
}
- parentsParent.setItem(parentIndex,newParent);
+ parentsParent.setItem(parentIndex, newParent);
}
}
@@ -338,19 +337,19 @@ public class Evaluation {
if (first instanceof NullItem) {
return second;
} else if (first instanceof NotItem) {
- NotItem notItem=(NotItem)first;
- if (termType==TermType.NOT) {
+ NotItem notItem = (NotItem)first;
+ if (termType == TermType.NOT) {
notItem.addNegativeItem(second);
}
else {
- Item newPositive=combineItems(notItem.getPositiveItem(),second,termType);
+ Item newPositive = combineItems(notItem.getPositiveItem(), second, termType);
notItem.setPositiveItem(newPositive);
}
return notItem;
}
else if (first instanceof CompositeItem) {
- CompositeItem composite=(CompositeItem)first;
- CompositeItem combined=createType(termType);
+ CompositeItem composite = (CompositeItem)first;
+ CompositeItem combined = createType(termType);
if (combined.getClass().equals(composite.getClass())) {
composite.addItem(second);
return composite;
@@ -362,7 +361,7 @@ public class Evaluation {
}
}
else if (first instanceof TermItem) {
- CompositeItem combined=createType(termType);
+ CompositeItem combined = createType(termType);
combined.addItem(first);
combined.addItem(second);
return combined;
diff --git a/container-search/src/main/java/com/yahoo/prelude/semantics/engine/Match.java b/container-search/src/main/java/com/yahoo/prelude/semantics/engine/Match.java
index 9e7c761deba..a87338879fe 100644
--- a/container-search/src/main/java/com/yahoo/prelude/semantics/engine/Match.java
+++ b/container-search/src/main/java/com/yahoo/prelude/semantics/engine/Match.java
@@ -6,6 +6,8 @@ import com.yahoo.prelude.query.Item;
import com.yahoo.prelude.query.TermItem;
import com.yahoo.prelude.query.WordItem;
+import java.util.Objects;
+
/**
* A match
*
@@ -14,15 +16,15 @@ import com.yahoo.prelude.query.WordItem;
public class Match {
/** The start position of this match */
- private int position;
+ private final int position;
- private TermItem item;
+ private final TermItem item;
/** The string to replace the match by, usually item.getIndexedString() */
- private String replaceValue;
+ private final String replaceValue;
/** The parent of the matched item */
- private CompositeItem parent=null;
+ private final CompositeItem parent;
/**
* Creates a match
@@ -56,23 +58,25 @@ public class Match {
*/
public CompositeItem getParent() { return parent; }
- public int hashCode() {
- return
- 17*item.getIndexedString().hashCode()+
- 33*item.getIndexName().hashCode();
- }
-
/** Returns a new item representing this match */
public Item toItem(String label) {
- return new WordItem(getReplaceValue(),label);
+ var newItem = new WordItem(getReplaceValue(), label);
+ newItem.setWeight(item.getWeight());
+ return newItem;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(item.getIndexedString(), item.getIndexName());
}
+ @Override
public boolean equals(Object o) {
if (! (o instanceof Match)) return false;
- Match other=(Match)o;
- if (other.position!=position) return false;
- if (!other.item.equals(item)) return false;
+ Match other = (Match)o;
+ if (other.position != position) return false;
+ if ( ! other.item.equals(item)) return false;
return true;
}
diff --git a/container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java b/container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java
index 274528f1fb3..f21f861a801 100644
--- a/container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java
+++ b/container-search/src/main/java/com/yahoo/prelude/semantics/engine/ReferencedMatches.java
@@ -14,12 +14,12 @@ import com.yahoo.prelude.query.PhraseItem;
*/
public class ReferencedMatches {
- private String contextName;
+ private final String contextName;
- private List<Match> matches=new java.util.ArrayList<>(1);
+ private final List<Match> matches = new java.util.ArrayList<>(1);
public ReferencedMatches(String contextName) {
- this.contextName=contextName;
+ this.contextName = contextName;
}
public void addMatch(Match match) {
@@ -38,12 +38,12 @@ public class ReferencedMatches {
* @param label the label of the matches
*/
public Item toItem(String label) {
- if (matches.size()==0) return null;
- if (matches.size()==1) return matches.get(0).toItem(label);
+ if (matches.size() == 0) return null;
+ if (matches.size() == 1) return matches.get(0).toItem(label);
- PhraseItem phrase=new PhraseItem(); // TODO: Somehow allow AND items instead here
+ PhraseItem phrase = new PhraseItem(); // TODO: Somehow allow AND items instead here
phrase.setIndexName(label);
- for (Iterator<Match> i=matches.iterator(); i.hasNext(); ) {
+ for (Iterator<Match> i = matches.iterator(); i.hasNext(); ) {
phrase.addItem(i.next().toItem(label));
}
return phrase;
diff --git a/container-search/src/main/java/com/yahoo/prelude/semantics/rule/LiteralPhraseProduction.java b/container-search/src/main/java/com/yahoo/prelude/semantics/rule/LiteralPhraseProduction.java
index cad753a570b..d06c4144fbc 100644
--- a/container-search/src/main/java/com/yahoo/prelude/semantics/rule/LiteralPhraseProduction.java
+++ b/container-search/src/main/java/com/yahoo/prelude/semantics/rule/LiteralPhraseProduction.java
@@ -19,7 +19,7 @@ import com.yahoo.protect.Validator;
*/
public class LiteralPhraseProduction extends TermProduction {
- private List<String> terms=new ArrayList<>();
+ private final List<String> terms = new ArrayList<>();
/** Creates a new produced literal phrase */
public LiteralPhraseProduction() {
@@ -45,20 +45,20 @@ public class LiteralPhraseProduction extends TermProduction {
public List<String> getTerms() { return Collections.unmodifiableList(terms); }
public void produce(RuleEvaluation e,int offset) {
- PhraseItem newPhrase=new PhraseItem();
+ PhraseItem newPhrase = new PhraseItem();
newPhrase.setIndexName(getLabel());
for (String term : terms)
newPhrase.addItem(new WordItem(term));
if (replacing) {
- Match matched=e.getNonreferencedMatch(0);
- insertMatch(e,matched,newPhrase,offset);
+ Match matched = e.getNonreferencedMatch(0);
+ insertMatch(e, matched, newPhrase, offset);
}
else {
newPhrase.setWeight(getWeight());
- if (e.getTraceLevel()>=6)
- e.trace(6,"Adding '" + newPhrase + "'");
- e.addItem(newPhrase,getTermType());
+ if (e.getTraceLevel() >= 6)
+ e.trace(6, "Adding '" + newPhrase + "'");
+ e.addItem(newPhrase, getTermType());
}
}
@@ -67,8 +67,8 @@ public class LiteralPhraseProduction extends TermProduction {
}
private String getSpaceSeparated(List<String> terms) {
- StringBuilder builder=new StringBuilder();
- for (Iterator<String> i=terms.iterator(); i.hasNext(); ) {
+ StringBuilder builder = new StringBuilder();
+ for (Iterator<String> i = terms.iterator(); i.hasNext(); ) {
builder.append(i.next());
if (i.hasNext())
builder.append(" ");
diff --git a/container-search/src/main/java/com/yahoo/prelude/semantics/rule/LiteralTermProduction.java b/container-search/src/main/java/com/yahoo/prelude/semantics/rule/LiteralTermProduction.java
index 69a4a87c04e..66d1df690bb 100644
--- a/container-search/src/main/java/com/yahoo/prelude/semantics/rule/LiteralTermProduction.java
+++ b/container-search/src/main/java/com/yahoo/prelude/semantics/rule/LiteralTermProduction.java
@@ -44,31 +44,32 @@ public class LiteralTermProduction extends TermProduction {
* @param literal this term word
* @param termType the type of term to produce
*/
- public LiteralTermProduction(String label,String literal, TermType termType) {
- super(label,termType);
+ public LiteralTermProduction(String label, String literal, TermType termType) {
+ super(label, termType);
setLiteral(literal);
}
/** The literal term value, never null */
public void setLiteral(String literal) {
- Validator.ensureNotNull("A produced term",literal);
+ Validator.ensureNotNull("A produced term", literal);
this.literal=literal;
}
/** Returns the term word produced, never null */
public String getLiteral() { return literal; }
- public void produce(RuleEvaluation e,int offset) {
- WordItem newItem=new WordItem(literal,getLabel());
+ public void produce(RuleEvaluation e, int offset) {
+ WordItem newItem = new WordItem(literal, getLabel());
if (replacing) {
- Match matched=e.getNonreferencedMatch(0);
- insertMatch(e,matched,newItem,offset);
+ Match matched = e.getNonreferencedMatch(0);
+ newItem.setWeight(matched.getItem().getWeight());
+ insertMatch(e, matched, newItem, offset);
}
else {
newItem.setWeight(getWeight());
- if (e.getTraceLevel()>=6)
- e.trace(6,"Adding '" + newItem + "'");
- e.addItem(newItem,getTermType());
+ if (e.getTraceLevel() >= 6)
+ e.trace(6, "Adding '" + newItem + "'");
+ e.addItem(newItem, getTermType());
}
}
diff --git a/container-search/src/main/java/com/yahoo/prelude/semantics/rule/Production.java b/container-search/src/main/java/com/yahoo/prelude/semantics/rule/Production.java
index 3073e2f7727..716622a4849 100644
--- a/container-search/src/main/java/com/yahoo/prelude/semantics/rule/Production.java
+++ b/container-search/src/main/java/com/yahoo/prelude/semantics/rule/Production.java
@@ -33,7 +33,7 @@ public abstract class Production {
public void setPosition(int position) { this.position = position; }
/** Sets the weight of this production as a percentage (default is 100) */
- public void setWeight(int weight) { this.weight=weight; }
+ public void setWeight(int weight) { this.weight = weight; }
/** Returns the weight of this production as a percentage (default is 100) */
public int getWeight() { return weight; }
diff --git a/container-search/src/main/java/com/yahoo/prelude/semantics/rule/ReferenceTermProduction.java b/container-search/src/main/java/com/yahoo/prelude/semantics/rule/ReferenceTermProduction.java
index d4593a5dbb9..e1bb8ff102d 100644
--- a/container-search/src/main/java/com/yahoo/prelude/semantics/rule/ReferenceTermProduction.java
+++ b/container-search/src/main/java/com/yahoo/prelude/semantics/rule/ReferenceTermProduction.java
@@ -48,7 +48,7 @@ public class ReferenceTermProduction extends TermProduction {
* @param label the label of the produced term
* @param reference the label of the condition this should take it's value from
*/
- public ReferenceTermProduction(String label,String reference) {
+ public ReferenceTermProduction(String label, String reference) {
super(label);
setReference(reference);
}
@@ -60,15 +60,15 @@ public class ReferenceTermProduction extends TermProduction {
* @param reference the label of the condition this should take it's value from
* @param termType the type of term to produce
*/
- public ReferenceTermProduction(String label,String reference, TermType termType) {
- super(label,termType);
+ public ReferenceTermProduction(String label, String reference, TermType termType) {
+ super(label, termType);
setReference(reference);
}
/** The label of the condition this should take its value from, never null */
public void setReference(String reference) {
Validator.ensureNotNull("reference name of a produced reference term",reference);
- this.reference =reference;
+ this.reference = reference;
}
/** Returns the label of the condition this should take its value from, never null */
@@ -78,29 +78,29 @@ public class ReferenceTermProduction extends TermProduction {
matchReferences.add(reference);
}
- public void produce(RuleEvaluation e,int offset) {
- ReferencedMatches referencedMatches=e.getReferencedMatches(reference);
- if (referencedMatches==null)
+ public void produce(RuleEvaluation e, int offset) {
+ ReferencedMatches referencedMatches = e.getReferencedMatches(reference);
+ if (referencedMatches == null)
throw new EvaluationException("Referred match '" + reference + "' not found");
if (replacing) {
- replaceMatches(e,referencedMatches);
+ replaceMatches(e, referencedMatches);
}
else {
- addMatches(e,referencedMatches);
+ addMatches(e, referencedMatches);
}
}
- public void replaceMatches(RuleEvaluation e,ReferencedMatches referencedMatches) {
- Item referencedItem=referencedMatches.toItem(getLabel());
- if (referencedItem==null) return;
+ public void replaceMatches(RuleEvaluation e, ReferencedMatches referencedMatches) {
+ Item referencedItem = referencedMatches.toItem(getLabel());
+ if (referencedItem == null) return;
e.removeMatches(referencedMatches);
- insertMatch(e, referencedMatches.matchIterator().next(),referencedItem,0);
+ insertMatch(e, referencedMatches.matchIterator().next(), referencedItem, 0);
}
- private void addMatches(RuleEvaluation e,ReferencedMatches referencedMatches) {
- Item referencedItem=referencedMatches.toItem(getLabel());
- if (referencedItem==null) return;
- e.addItem(referencedItem,getTermType());
+ private void addMatches(RuleEvaluation e, ReferencedMatches referencedMatches) {
+ Item referencedItem = referencedMatches.toItem(getLabel());
+ if (referencedItem == null) return;
+ e.addItem(referencedItem, getTermType());
}
public String toInnerTermString() {
diff --git a/container-search/src/main/java/com/yahoo/prelude/semantics/rule/TermProduction.java b/container-search/src/main/java/com/yahoo/prelude/semantics/rule/TermProduction.java
index 847014ff646..d1a74a991da 100644
--- a/container-search/src/main/java/com/yahoo/prelude/semantics/rule/TermProduction.java
+++ b/container-search/src/main/java/com/yahoo/prelude/semantics/rule/TermProduction.java
@@ -51,7 +51,7 @@ public abstract class TermProduction extends Production {
/** Sets the term type to produce */
public void setTermType(TermType termType) {
- Validator.ensureNotNull("Type of produced Term",termType);
+ Validator.ensureNotNull("Type of produced Term", termType);
this.termType = termType;
}
@@ -60,19 +60,21 @@ public abstract class TermProduction extends Production {
* TODO: Move to ruleevaluation
*/
protected void insertMatch(RuleEvaluation e, Match matched, Item newItem, int offset) {
- newItem.setWeight(getWeight());
- int insertPosition=matched.getPosition()+offset;
+ if (getWeight() != 100)
+ newItem.setWeight(getWeight());
+ int insertPosition = matched.getPosition()+offset;
// This check is necessary (?) because earlier items may have been removed
// after we recorded the match position. It is sort of hackish. A cleaner
// solution would be to update the match position on changes
- if (insertPosition>matched.getParent().getItemCount()) {
- insertPosition=matched.getParent().getItemCount();
+ if (insertPosition > matched.getParent().getItemCount()) {
+ insertPosition = matched.getParent().getItemCount();
}
- e.insertItem(newItem,matched.getParent(),insertPosition,getTermType());
- if (e.getTraceLevel()>=6)
- e.trace(6,"Inserted item '" + newItem + "' at position " + insertPosition + " producing " + e.getEvaluation().getQuery().getModel().getQueryTree());
+ e.insertItem(newItem, matched.getParent(), insertPosition,getTermType());
+ if (e.getTraceLevel() >= 6)
+ e.trace(6, "Inserted item '" + newItem + "' at position " + insertPosition + " producing " +
+ e.getEvaluation().getQuery().getModel().getQueryTree());
}
protected String getLabelString() {
diff --git a/container-search/src/test/java/com/yahoo/prelude/semantics/test/RuleBaseAbstractTestCase.java b/container-search/src/test/java/com/yahoo/prelude/semantics/test/RuleBaseAbstractTestCase.java
index 41597a22832..81d359a804d 100644
--- a/container-search/src/test/java/com/yahoo/prelude/semantics/test/RuleBaseAbstractTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/semantics/test/RuleBaseAbstractTestCase.java
@@ -57,8 +57,8 @@ public abstract class RuleBaseAbstractTestCase {
}
protected Query assertSemantics(String result, String input, int tracelevel, Query.Type queryType) {
- Query query=new Query("?query=" + QueryTestCase.httpEncode(input) + "&tracelevel=0&tracelevel.rules=" + tracelevel +
- "&language=und&type=" + queryType.toString());
+ Query query = new Query("?query=" + QueryTestCase.httpEncode(input) + "&tracelevel=0&tracelevel.rules=" + tracelevel +
+ "&language=und&type=" + queryType);
return assertSemantics(result, query);
}
diff --git a/container-search/src/test/java/com/yahoo/prelude/semantics/test/SemanticSearcherTestCase.java b/container-search/src/test/java/com/yahoo/prelude/semantics/test/SemanticSearcherTestCase.java
index 5e5df9d2005..2e43eae3775 100644
--- a/container-search/src/test/java/com/yahoo/prelude/semantics/test/SemanticSearcherTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/semantics/test/SemanticSearcherTestCase.java
@@ -24,7 +24,6 @@ import static org.junit.Assert.assertEquals;
*
* @author bratseth
*/
-@SuppressWarnings("deprecation")
public class SemanticSearcherTestCase extends RuleBaseAbstractTestCase {
public SemanticSearcherTestCase() {
@@ -35,6 +34,8 @@ public class SemanticSearcherTestCase extends RuleBaseAbstractTestCase {
public void testSingleShopping() {
assertSemantics("brand:sony",
"sony");
+ assertSemantics("brand:sony!150",
+ "sony!150");
}
@Test
@@ -63,7 +64,7 @@ public class SemanticSearcherTestCase extends RuleBaseAbstractTestCase {
@Test
public void testLiteralReplacing() {
- assertSemantics("AND lord of rings","lotr");
+ assertSemantics("AND lord of rings", "lotr");
}
@Test
diff --git a/container-search/src/test/java/com/yahoo/prelude/semantics/test/WeightingTestCase.java b/container-search/src/test/java/com/yahoo/prelude/semantics/test/WeightingTestCase.java
index 349a3502c0f..3e684ca6c04 100644
--- a/container-search/src/test/java/com/yahoo/prelude/semantics/test/WeightingTestCase.java
+++ b/container-search/src/test/java/com/yahoo/prelude/semantics/test/WeightingTestCase.java
@@ -14,12 +14,12 @@ public class WeightingTestCase extends RuleBaseAbstractTestCase {
@Test
public void testWeighting() {
- assertSemantics("foo!150","foo");
- assertSemantics("AND foo!150 snip","foo snip");
- assertSemantics("AND foo!150 bar","foo bar");
- assertSemantics("AND bar!57 foo","bar foo");
- assertSemantics("AND foo!150 fu","foo fu");
- assertSemantics("AND foo!150 bar kanoo boat!237","foo bar kanoo");
+ assertSemantics("foo!150", "foo");
+ assertSemantics("AND foo!150 snip", "foo snip");
+ assertSemantics("AND foo!150 bar", "foo bar");
+ assertSemantics("AND bar!57 foo!150", "bar foo");
+ assertSemantics("AND foo!150 fu", "foo fu");
+ assertSemantics("AND foo!150 bar kanoo boat!237", "foo bar kanoo");
}
}