C - the type of object stored in the dictionarypublic class DictionaryEntry<C> extends Object implements Compilable, Scored
DictionaryEntry provides a phrase as a string, an
object-based category for the phrase, and a double-valued score.
Equality for dictionary entries involves equality of the
phrase and category components; dictionaries should not contain
entries with the same phrase and category and different scores.| Constructor and Description |
|---|
DictionaryEntry(String phrase,
C category)
Construct a dictionary entry with the specified
phrase and category, with count and score
set to
1. |
DictionaryEntry(String phrase,
C category,
double score)
Construct a dictionary entry with the specified phrase,
category and score, with a count of zero.
|
DictionaryEntry(String phrase,
C category,
int count)
Construct a dictionary entry with the specified
phrase, category and count, with the score set
to the count value.
|
DictionaryEntry(String phrase,
C category,
int count,
double score)
Construct a dictionary entry with the specified
phrase, category, count and score.
|
| Modifier and Type | Method and Description |
|---|---|
C |
category()
Returns the category for this dictionary entry.
|
void |
compileTo(ObjectOutput objOut)
Compiles this dictionary entry to the specified object output.
|
int |
count()
Returns the count for this dictionary entry.
|
boolean |
equals(Object that)
Returns
true if the specified object is a
dictionary object equal to this one. |
int |
hashCode()
Returns the hash code for this entry.
|
String |
phrase()
Returns the phrase for this dictionary entry.
|
double |
score()
Returns the score for this dictionary entry.
|
String |
toString()
Returns a string-based representation of this entry.
|
public DictionaryEntry(String phrase, C category, int count, double score)
phrase - Phrase for the constructed entry.category - Category for the constructed entry.count - Count for the constructed entry.score - Score for the constructed entry.public DictionaryEntry(String phrase, C category, double score)
phrase - Phrase for the constructed entry.category - Category for the constructed entry.score - Score for the constructed entry.public DictionaryEntry(String phrase, C category, int count)
phrase - Phrase for the constructed entry.category - Category for the constructed entry.count - Count for the constructed entry.public String phrase()
public C category()
public double score()
public int count()
public String toString()
public boolean equals(Object that)
true if the specified object is a
dictionary object equal to this one. Equality is
defined in terms of equality of phrases, categories,
counts and scores; all must be equal for entries
to be equal. Equality is defined consistently with
hashCode().public int hashCode()
equals(Object).public void compileTo(ObjectOutput objOut) throws IOException
compileTo in interface CompilableobjOut - Output to which object is written.IOException - If there is an I/O error compiling the
object.Copyright © 2019 Alias-i, Inc.. All rights reserved.