java.lang.Object
me.gosimple.nbvcxz.resources.DictionaryBuilder
Dictionary builder class to help properly build dictionaries.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd word to dictionary.addWords(Collection<String> words, int rank) Add a Collection of words to dictionary.Creates the dictionary.setDictionaryName(String dictionary_name) Set the dictionary namesetExclusion(boolean exclusion) Set if exclusion dictionary or not.
-
Constructor Details
-
DictionaryBuilder
public DictionaryBuilder()
-
-
Method Details
-
setDictionaryName
Set the dictionary name- Parameters:
dictionary_name- unique name of dictionary.- Returns:
- the builder
-
setExclusion
Set if exclusion dictionary or not.- Parameters:
exclusion-truewhen desiring to disallow any password contained in this dictionary;falseotherwise.- Returns:
- the builder
-
addWord
Add word to dictionary.- Parameters:
word- key to add to the dictionary, will be lowercased.rank- the rank of the word in the dictionary. Should increment from most common to least common if ranked. If unranked, an example would be if there were 500 values in the dictionary, every word should have a rank of 250. If exclusion dictionary, rank is unimportant (set to 0).- Returns:
- the builder
-
addWords
Add a Collection of words to dictionary. All words will be added to dictionary using the same rank.- Parameters:
words- the collection of keys to be added to dictionaryrank- the rank of the word in the dictionary. Should increment from most common to least common if ranked. If unranked, an example would be if there were 500 values in the dictionary, every word should have a rank of 250. If exclusion dictionary, rank is unimportant (set to 0).- Returns:
- the builder
-
createDictionary
Creates the dictionary.- Returns:
- the dictionary
-