public class DefaultTermNGram extends AbstractTerm implements TermNGram
TermNGram
interface.Modifier and Type | Field and Description |
---|---|
protected Term[] |
terms
The array of terms that make up the n-gram.
|
Constructor and Description |
---|
DefaultTermNGram()
Creates a new
DefaultTermNGram . |
DefaultTermNGram(Term... terms)
Creates a new
DefaultTermNGram . |
Modifier and Type | Method and Description |
---|---|
DefaultTermNGram |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
java.lang.String |
getName()
The name of the n-gram term is
[<n>-gram: <list>] where n is the
size ot this n-gram and list is a comma-separated list of the internal
term names. |
Term |
getTerm(int i)
Gets the i-th term in the n-gram.
|
int |
getTermCount()
Gets the number of terms in the n-gram.
|
java.util.List<Term> |
getTermList()
Gets the list of terms in the n-gram.
|
Term[] |
getTerms()
Gets the terms that make up the n-gram.
|
void |
setTerms(Term... terms)
Sets the terms that make up the n-gram.
|
asTerm, equals, equals, hashCode, toString
protected Term[] terms
public DefaultTermNGram()
DefaultTermNGram
.public DefaultTermNGram(Term... terms)
DefaultTermNGram
.terms
- The terms that make up the n-gram.public DefaultTermNGram clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractCloneableSerializable
public java.lang.String getName()
[<n>-gram: <list>]
where n is the
size ot this n-gram and list is a comma-separated list of the internal
term names.public int getTermCount()
TermNGram
getTermCount
in interface TermNGram
public Term getTerm(int i)
TermNGram
public java.util.List<Term> getTermList()
TermNGram
getTermList
in interface TermNGram
public Term[] getTerms()
public void setTerms(Term... terms)
terms
- The terms that make up the n-gram.