java.lang.Object
me.gosimple.nbvcxz.resources.DictionaryBuilder
public class DictionaryBuilder
extends java.lang.Object
Dictionary builder class to help properly build dictionaries.
-
Constructor Summary
Constructors Constructor Description DictionaryBuilder() -
Method Summary
Modifier and Type Method Description DictionaryBuilderaddWord(java.lang.String word, int rank)Add word to dictionary.DictionaryBuilderaddWords(java.util.Collection<java.lang.String> words, int rank)Add a Collection of words to dictionary.DictionarycreateDictionary()Creates the dictionary.DictionaryBuildersetDictionaryName(java.lang.String dictionary_name)Set the dictionary nameDictionaryBuildersetExclusion(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
-