Пример #1
0
 /// <summary>
 /// Loads all dictionary (.dic) files from the specified directories and returns a Vocabulary object that contains the loaded dictionaries.
 /// </summary>
 /// <param name="directories">The directories from which to load dictionaries.</param>
 /// <param name="filter">Indicates whether dictionary entries marked with the #nsfw flag should be loaded.</param>
 /// <returns></returns>
 public static RantVocabulary FromMultiDirectory(string[] directories, NsfwFilter filter)
 {
     return(new RantVocabulary(directories.SelectMany(path => Directory.GetFiles(path, "*.dic", SearchOption.AllDirectories)).Select(file => RantDictionary.FromFile(file, filter))));
 }
Пример #2
0
 /// <summary>
 /// Loads all dictionary (.dic) files from the specified directory and returns a Vocabulary object that contains the loaded dictionaries.
 /// </summary>
 /// <param name="directory">The directory from which to load dictionaries.</param>
 /// <param name="filter">Indicates whether dictionary entries marked with the #nsfw flag should be loaded.</param>
 /// <returns></returns>
 public static RantVocabulary FromDirectory(string directory, NsfwFilter filter)
 {
     return(new RantVocabulary(Directory.GetFiles(directory, "*.dic", SearchOption.AllDirectories).Select(file => RantDictionary.FromFile(file, filter)).ToList()));
 }