Class DictionaryUtil

java.lang.Object
me.gosimple.nbvcxz.resources.DictionaryUtil

public class DictionaryUtil extends Object
Author:
Adam Brusselback
  • Field Details

  • Constructor Details

    • DictionaryUtil

      public DictionaryUtil()
  • Method Details

    • loadUnrankedDictionary

      public static Map<String,Integer> loadUnrankedDictionary(String fileName)
      Read a resource file with a list of entries (sorted by frequency) and use it to create a ranked dictionary.

      The dictionary must contain only lower case values for the matching to work properly.

      Parameters:
      fileName - the name of the file
      Returns:
      the ranked dictionary (a HashMap which associated a rank to each entry
    • loadRankedDictionary

      public static Map<String,Integer> loadRankedDictionary(String fileName)
      Read a resource file with a list of entries (sorted by frequency) and use it to create a ranked dictionary.

      The dictionary must contain only lower case values for the matching to work properly.

      Parameters:
      fileName - the name of the file
      Returns:
      the ranked dictionary (a HashMap which associated a rank to each entry