Package com.yahoo.prelude.querytransform
Class PhraseMatcher.Phrase
- java.lang.Object
-
- com.yahoo.prelude.querytransform.PhraseMatcher.Phrase
-
- Enclosing class:
- PhraseMatcher
public static class PhraseMatcher.Phrase extends java.lang.Object
Points to a collection of word items (one or more) which is matches a complete listing in an automat
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PhraseMatcher.Phrase.MatchIterator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBackedLength()
Returns the length of the underlying phrasejava.lang.String
getData()
Returns the data stored by the automaton for this phrase at this position, or null if noneTermItem
getItem(int index)
Returns the n'th item in this, throws if index out of boundsint
getLength()
CompositeItem
getOwner()
Returns the owner, or null if this is a single item phrase with no ownerint
getStartIndex()
boolean
isComplete()
Returns true if this phrase contains all the words of the owner, or if there is no ownerPhraseMatcher.Phrase.MatchIterator
itemIterator()
Returns the items of this phrase as a read-only iteratorvoid
remove()
Removes the word items of this phrase.void
replace()
Replaces the words items of this phrase with a phrase item.java.lang.String
toString()
-
-
-
Constructor Detail
-
Phrase
public Phrase(TermItem item, java.lang.String replace, java.lang.String data)
-
-
Method Detail
-
getOwner
public CompositeItem getOwner()
Returns the owner, or null if this is a single item phrase with no owner
-
getStartIndex
public int getStartIndex()
-
getLength
public int getLength()
-
getData
public java.lang.String getData()
Returns the data stored by the automaton for this phrase at this position, or null if none
-
getItem
public TermItem getItem(int index)
Returns the n'th item in this, throws if index out of bounds
-
isComplete
public boolean isComplete()
Returns true if this phrase contains all the words of the owner, or if there is no owner
-
replace
public void replace()
Replaces the words items of this phrase with a phrase item. Does nothing if this is not a composite match
-
remove
public void remove()
Removes the word items of this phrase. Does nothing nuless this is a composite
-
getBackedLength
public int getBackedLength()
Returns the length of the underlying phrase
-
itemIterator
public PhraseMatcher.Phrase.MatchIterator itemIterator()
Returns the items of this phrase as a read-only iterator
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-