프로퍼티 | 타입 | 설명 | |
---|---|---|---|
classmap | TernaryTree | ||
stoplist | IList | ||
vspace | Lucene.Net.Analysis.Compound.Hyphenation.ByteVector |
메소드 | 설명 | |
---|---|---|
AddClass ( string chargroup ) : void |
Add a character class to the tree. It is used by PatternParser PatternParser as callback to add character classes. Character classes define the valid word characters for hyphenation. If a word contains a character not defined in any of the classes, it is not hyphenated. It also defines a way to normalize the characters in order to compare them with the stored patterns. Usually pattern files use only lower case characters, in this case a class for letter 'a', for example, should be defined as "aA", the first character being the normalization char.
|
|
AddException ( string word, List |
Add an exception to the tree. It is used by PatternParser PatternParser class as callback to store the hyphenation exceptions.
|
|
AddPattern ( string pattern, string ivalue ) : void |
Add a pattern to the tree. Mainly, to be used by PatternParser PatternParser class as callback to add a pattern to the tree.
|
|
FindPattern ( string pat ) : string | ||
Hyphenate ( char w, int offset, int len, int remainCharCount, int pushCharCount ) : |
Hyphenate word and return an array of hyphenation points.
|
|
Hyphenate ( string word, int remainCharCount, int pushCharCount ) : |
Hyphenate word and return a Hyphenation object.
|
|
HyphenationTree ( ) : Lucene.Net.Support | ||
LoadPatterns ( FileInfo f ) : void |
Read hyphenation patterns from an XML file.
|
|
LoadPatterns ( FileInfo f, |
Read hyphenation patterns from an XML file.
|
|
LoadPatterns ( System.Stream source ) : void |
Read hyphenation patterns from an XML file.
|
|
LoadPatterns ( System.Stream source, |
Read hyphenation patterns from an XML file.
|
|
LoadPatterns ( XmlReader source ) : void | ||
LoadPatterns ( string filename ) : void |
Read hyphenation patterns from an XML file.
|
|
LoadPatterns ( string filename, |
Read hyphenation patterns from an XML file.
|
메소드 | 설명 | |
---|---|---|
GetValues ( int k ) : sbyte[] | ||
HStrCmp ( char s, int si, char t, int ti ) : int |
String compare, returns 0 if equal or t is a substring of s
|
|
PackValues ( string values ) : int |
Packs the values by storing them in 4 bits, two values into a byte Values range is from 0 to 9. We use zero as terminator, so we'll add 1 to the value.
|
|
SearchPatterns ( char word, int index, sbyte il ) : void |
Search for all possible partial matches of word starting at index an update interletter values. In other words, it does something like: for(i=0; i<patterns.length; i++) { if ( word.substring(index).startsWidth(patterns[i]) ) update_interletter_values(patterns[i]); } But it is done in an efficient way since the patterns are stored in a ternary tree. In fact, this is the whole purpose of having the tree: doing this search without having to test every single pattern. The number of patterns for languages such as English range from 4000 to 10000. Thus, doing thousands of string comparisons for each word to hyphenate would be really slow without the tree. The tradeoff is memory, but using a ternary tree instead of a trie, almost halves the the memory used by Lout or TeX. It's also faster than using a hash table
|
|
UnpackValues ( int k ) : string |
public AddException ( string word, List | ||
word | string | normalized word |
hyphenatedword | List | a vector of alternating strings and
/// |
리턴 | void |
public AddPattern ( string pattern, string ivalue ) : void | ||
pattern | string | the hyphenation pattern |
ivalue | string | interletter weight values indicating the desirability and /// priority of hyphenating at a given point within the pattern. It /// should contain only digit characters. (i.e. '0' to '9'). |
리턴 | void |
protected HStrCmp ( char s, int si, char t, int ti ) : int | ||
s | char | |
si | int | |
t | char | |
ti | int | |
리턴 | int |
public Hyphenate ( char w, int offset, int len, int remainCharCount, int pushCharCount ) : |
||
w | char | char array that contains the word |
offset | int | Offset to first character in word |
len | int | Length of word |
remainCharCount | int | Minimum number of characters allowed before the /// hyphenation point. |
pushCharCount | int | Minimum number of characters allowed after the /// hyphenation point. |
리턴 |
public Hyphenate ( string word, int remainCharCount, int pushCharCount ) : |
||
word | string | the word to be hyphenated |
remainCharCount | int | Minimum number of characters allowed before the /// hyphenation point. |
pushCharCount | int | Minimum number of characters allowed after the /// hyphenation point. |
리턴 |
public LoadPatterns ( FileInfo f, |
||
f | FileInfo | the filename |
encoding | ||
리턴 | void |
public LoadPatterns ( System.Stream source ) : void | ||
source | System.Stream | the InputSource for the file |
리턴 | void |
public LoadPatterns ( System.Stream source, |
||
source | System.Stream | the InputSource for the file |
encoding | ||
리턴 | void |
public LoadPatterns ( string filename, |
||
filename | string | |
encoding | ||
리턴 | void |
protected PackValues ( string values ) : int | ||
values | string | a string of digits from '0' to '9' representing the /// interletter values. |
리턴 | int |
protected SearchPatterns ( char word, int index, sbyte il ) : void | ||
word | char | null terminated word to match |
index | int | start index from word |
il | sbyte | interletter values array to update |
리턴 | void |