C# 클래스 ABB.Swum.Utilities.LibFileLoader

Contains various utility functions for loading library data files.
파일 보기 프로젝트 열기: abb-iss/Swum.NET

공개 메소드들

메소드 설명
ReadStemFile ( string path ) : string>.Dictionary

Reads a word stem file and parses it into a dictionary. The file is assumed to contain one entry per line, with each entry of the format "[word] [stem]". If the file contains duplicate entries for a given word, only the last entry will be in the dictionary.

ReadVerbParticleFile ( string path ) : HashSet>.Dictionary

Reads the verb particle file at the given path and reads it into a Dictionary. Each line of the file should be in the format: [verb] [particle]. The returned Dictionary maps a particle to a set of verbs.

ReadWordCount ( string path ) : int>.Dictionary

Reads a word count file and parses it into a dictionary. The file is assumed to contain one entry per line, with each entry of the format "[count] [word]". Count must be a non-negative whole number. If the file contains duplicate entries for a given word, only the last entry will be in the dictionary. Words are converted to lower case before being added to the dictionary.

ReadWordCount ( string path, bool keepOriginalCasing ) : int>.Dictionary

Reads a word count file and parses it into a dictionary. The file is assumed to contain one entry per line, with each entry of the format "[count] [word]". Count must be a non-negative whole number. If the file contains duplicate entries for a given word, only the last entry will be in the dictionary. Words are converted to lower case before being added to the dictionary.

ReadWordCount ( string path, bool keepOriginalCase, Func includeFunction ) : int>.Dictionary

Reads a word count file and parses it into a dictionary. The file is assumed to contain one entry per line, with each entry of the format "[count] [word]". Count must be a non-negative whole number. If the file contains duplicate entries for a given word, only the last entry will be in the dictionary.

ReadWordList ( ) : HashSet

Reads a file containing a list of words, and returns it as a set. The file is assumed to contain a single word on each line. Duplicate words will be ignored. Words are converted to lower case before being added.

ReadWordList ( bool keepOriginalCase ) : HashSet

Reads a file containing a list of words, and returns it as a set. The file is assumed to contain a single word on each line. Duplicate words will be ignored.

WriteWordCount ( int>.Dictionary wordCount, string path ) : void

Writes a word count dictionary to a file. Each dictionary entry is written in the format "[count] [word]".

메소드 상세

ReadStemFile() 공개 정적인 메소드

Reads a word stem file and parses it into a dictionary. The file is assumed to contain one entry per line, with each entry of the format "[word] [stem]". If the file contains duplicate entries for a given word, only the last entry will be in the dictionary.
public static ReadStemFile ( string path ) : string>.Dictionary
path string The file to read.
리턴 string>.Dictionary

ReadVerbParticleFile() 공개 정적인 메소드

Reads the verb particle file at the given path and reads it into a Dictionary. Each line of the file should be in the format: [verb] [particle]. The returned Dictionary maps a particle to a set of verbs.
public static ReadVerbParticleFile ( string path ) : HashSet>.Dictionary
path string The verb particle file to read.
리턴 HashSet>.Dictionary

ReadWordCount() 공개 정적인 메소드

Reads a word count file and parses it into a dictionary. The file is assumed to contain one entry per line, with each entry of the format "[count] [word]". Count must be a non-negative whole number. If the file contains duplicate entries for a given word, only the last entry will be in the dictionary. Words are converted to lower case before being added to the dictionary.
public static ReadWordCount ( string path ) : int>.Dictionary
path string The file to read.
리턴 int>.Dictionary

ReadWordCount() 공개 정적인 메소드

Reads a word count file and parses it into a dictionary. The file is assumed to contain one entry per line, with each entry of the format "[count] [word]". Count must be a non-negative whole number. If the file contains duplicate entries for a given word, only the last entry will be in the dictionary. Words are converted to lower case before being added to the dictionary.
public static ReadWordCount ( string path, bool keepOriginalCasing ) : int>.Dictionary
path string The file to read.
keepOriginalCasing bool If True, words are added to the dictionary in their original case. If False, words are converted to lower case.
리턴 int>.Dictionary

ReadWordCount() 공개 정적인 메소드

Reads a word count file and parses it into a dictionary. The file is assumed to contain one entry per line, with each entry of the format "[count] [word]". Count must be a non-negative whole number. If the file contains duplicate entries for a given word, only the last entry will be in the dictionary.
public static ReadWordCount ( string path, bool keepOriginalCase, Func includeFunction ) : int>.Dictionary
path string The file to read.
keepOriginalCase bool If True, words are added to the dictionary in their original case. If False, words are converted to lower case.
includeFunction Func A function specifying whether or not to include a given entry from the file. /// This takes a string and uint as parameters and returns True if the entry should be included and False otherwise.
리턴 int>.Dictionary

ReadWordList() 공개 정적인 메소드

Reads a file containing a list of words, and returns it as a set. The file is assumed to contain a single word on each line. Duplicate words will be ignored. Words are converted to lower case before being added.
public static ReadWordList ( ) : HashSet
리턴 HashSet

ReadWordList() 공개 정적인 메소드

Reads a file containing a list of words, and returns it as a set. The file is assumed to contain a single word on each line. Duplicate words will be ignored.
public static ReadWordList ( bool keepOriginalCase ) : HashSet
keepOriginalCase bool If True, words are added to the set in their original case. If False, words are converted to lower case.
리턴 HashSet

WriteWordCount() 공개 정적인 메소드

Writes a word count dictionary to a file. Each dictionary entry is written in the format "[count] [word]".
public static WriteWordCount ( int>.Dictionary wordCount, string path ) : void
wordCount int>.Dictionary The word count dictionary to write.
path string The file to write to.
리턴 void