public class SimpleDictionary extends Object implements Dictionary
Constructor and Description |
---|
SimpleDictionary(File aDict,
String aEncoding)
Constructor for a simple dictionary
|
SimpleDictionary(InputStream aDictStream,
String aEncoding) |
SimpleDictionary(String... aWords)
Create a simple dictionary from a list of string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String aWord)
Checks if a word is in the dictionary.
|
List<String> |
getAll()
Returns all words in the dictionary.
|
protected Set<String> |
readFileToSet(BufferedReader aReader)
Reads the dictionary to set
|
void |
setWords(Set<String> aWords) |
public SimpleDictionary(File aDict, String aEncoding) throws IOException
aDict
- The file with all wordsIOException
public SimpleDictionary(String... aWords)
aWords
- A list of wordspublic SimpleDictionary(InputStream aDictStream, String aEncoding) throws IOException
IOException
public boolean contains(String aWord)
Dictionary
contains
in interface Dictionary
aWord
- a word.protected Set<String> readFileToSet(BufferedReader aReader) throws IOException
aReader
- a reader,IOException
- if an I/O error occurs.public List<String> getAll()
Dictionary
getAll
in interface Dictionary
Copyright © 2007–2018 Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt. All rights reserved.