public static class WordCache.Dictionary
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.TreeSet<java.lang.StringBuilder> |
dict |
private java.util.TreeSet<java.lang.StringBuilder> |
tcid |
Constructor and Description |
---|
WordCache.Dictionary(java.io.File file) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.StringBuilder s)
check if the library contains the given word
|
java.util.Set<java.lang.StringBuilder> |
getWords() |
boolean |
isRelevant(int minimumWords)
a property that is used during the construction of recommendation:
if the dictionary is too small, then the non-existence of constructed words
is not relevant for the construction of artificially constructed words
If this property returns true, all other words must be in the dictionary
|
java.util.Set<java.lang.StringBuilder> |
recommend(java.lang.StringBuilder string)
read the dictionary and construct a set of recommendations to a given string
|
int |
size()
the size of the dictionary
|
boolean |
supports(java.lang.StringBuilder string)
check if the library supports the given word
A word is supported, if the library contains a word
that starts or ends with the given word
|
private final java.util.TreeSet<java.lang.StringBuilder> dict
private final java.util.TreeSet<java.lang.StringBuilder> tcid
public WordCache.Dictionary(java.io.File file) throws java.io.IOException
java.io.IOException
public java.util.Set<java.lang.StringBuilder> recommend(java.lang.StringBuilder string)
s
- input value that is used to match recommendationspublic boolean contains(java.lang.StringBuilder s)
s
- the given wordpublic boolean supports(java.lang.StringBuilder string)
s
- the given wordpublic int size()
public boolean isRelevant(int minimumWords)
minimumWords
- public java.util.Set<java.lang.StringBuilder> getWords()