|
ABL4J (Alignment Based Learning for Java) - 0.9.7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<IWord<T>>
org.schwiebert.abl4j.data.impl.abl.Sentence<T>
T - public class Sentence<T>
Represents a Sentence as a List of IWord objects.
| Field Summary | |
|---|---|
private String |
commentLine
An optional comment line |
private int |
sentenceId
storing the sentence ID |
private static long |
serialVersionUID
|
private Set<Integer> |
similars
keeping track of sentences to compare with |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
Sentence()
|
|
| Method Summary | |
|---|---|
void |
addWords(List<IWord<T>> words)
Adds all IWord stored in words to this sentence,
as in List.addAll(java.util.Collection). |
void |
buildSimilarSentencesSet()
This procedure considers each word in the sentence and fills the set "similars" with sentences to compare with as these sentences have at least one word in common. |
String |
getCommentLine()
Returns the commentLine |
int |
getSequenceId()
This procedure returns the sentence ID |
String |
getSequenceText()
Returns a string representation of this sequence. |
List<IWord<T>> |
getWords()
Returns the list of all IWords in this sentence. |
int |
indexOf(IWord<T> elem,
int index)
Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using
the equals method. |
boolean |
isSimilarTo(int id)
This procedure returns true if the current sentence has in its "similars" set the sentence specified with argument "id", and returns false if it has not, or if the map of similar sentences has not been created (Because ISentence.buildSimilarSentencesSet() has not been called). |
void |
registerWordsInSentence()
This procedure considers each word in the sentence and registers its appearance in the current sentence to facilitate future decisions on which sentences to compare with. |
void |
setCommentLine(String commentLine)
Sets the commentLine |
void |
setSequenceId(int id)
This procedure sets the sentence ID |
| Methods inherited from class java.util.ArrayList |
|---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.schwiebert.abl4j.data.ISentence |
|---|
get, size, subList |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
| Field Detail |
|---|
private static final long serialVersionUID
private int sentenceId
private Set<Integer> similars
private String commentLine
| Constructor Detail |
|---|
public Sentence()
| Method Detail |
|---|
public void setCommentLine(String commentLine)
ISentence
setCommentLine in interface ISentence<T>public String getCommentLine()
ISentence
getCommentLine in interface ISentence<T>public void setSequenceId(int id)
ISentence
setSequenceId in interface ISentence<T>public int getSequenceId()
ISentence
getSequenceId in interface ISentence<T>public void registerWordsInSentence()
ISentence
registerWordsInSentence in interface ISentence<T>public void buildSimilarSentencesSet()
ISentence
buildSimilarSentencesSet in interface ISentence<T>public boolean isSimilarTo(int id)
ISentenceISentence.buildSimilarSentencesSet() has not been called).
isSimilarTo in interface ISentence<T>public String getSequenceText()
ISentence
getSequenceText in interface ISentence<T>
public int indexOf(IWord<T> elem,
int index)
ISentenceindex, and testing for equality using
the equals method.
indexOf in interface ISentence<T>elem - an object.index - the non-negative index to start searching from.
index or later in the
sequence, that is, the smallest value k such that
elem.equals(elementData[k]) && (k >= index) is
true; returns -1 if the object is not
found. (Returns -1 if index >= the
current size of this sequence.)Object.equals(Object),
List.indexOf(Object)public List<IWord<T>> getWords()
ISentenceIWords in this sentence.
getWords in interface ISentence<T>public void addWords(List<IWord<T>> words)
ISentenceIWord stored in words to this sentence,
as in List.addAll(java.util.Collection).
addWords in interface ISentence<T>
|
ABL4J (Alignment Based Learning for Java) - 0.9.7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||