Method Hyphenate
Hyphenate(String, Int32, Int32)
Hyphenate word and return a Hyphenation object.
Declaration
public virtual Hyphenation Hyphenate(string word, int remainCharCount, int pushCharCount)
Parameters
Type | Name | Description |
---|---|---|
System.String | word | the word to be hyphenated |
System.Int32 | remainCharCount | Minimum number of characters allowed before the hyphenation point. |
System.Int32 | pushCharCount | Minimum number of characters allowed after the hyphenation point. |
Returns
Type | Description |
---|---|
Hyphenation | a Hyphenation object representing the hyphenated word or null if word is not hyphenated. |
Hyphenate(Char[], Int32, Int32, Int32, Int32)
Hyphenate word and return an array of hyphenation points.
Declaration
public virtual Hyphenation Hyphenate(char[] w, int offset, int len, int remainCharCount, int pushCharCount)
Parameters
Type | Name | Description |
---|---|---|
System.Char[] | w | char array that contains the word |
System.Int32 | offset | Offset to first character in word |
System.Int32 | len | Length of word |
System.Int32 | remainCharCount | Minimum number of characters allowed before the hyphenation point. |
System.Int32 | pushCharCount | Minimum number of characters allowed after the hyphenation point. |
Returns
Type | Description |
---|---|
Hyphenation | a Hyphenation object representing the hyphenated word or null if word is not hyphenated. |
Remarks
w = "*nnllllllnnn", where n is a non-letter, l is a letter, all n may be absent, the first n is at offset, the first l is at offset + iIgnoreAtBeginning; word = ".llllll.'\0'*", where all l in w are copied into word. In the first part of the routine len = w.length, in the second part of the routine len = word.length. Three indices are used: index(w), the index in w, index(word), the index in word, letterindex(word), the index in the letter part of word. The following relations exist: index(w) = offset + i - 1 index(word) = i - iIgnoreAtBeginning letterindex(word) = index(word) - 1 (see first loop). It follows that: index(w) - index(word) = offset - 1 + iIgnoreAtBeginning index(w) = letterindex(word) + offset + iIgnoreAtBeginning