org.foray.hyphen
Class Word4a

java.lang.Object
  extended by org.foray.hyphen.Word4a
All Implemented Interfaces:
Serializable, CharSequence, org.axsl.hyphen.Word, org.axsl.hyphen.WordSequenceContent
Direct Known Subclasses:
MutatingWord4a

public class Word4a
extends Object
implements org.axsl.hyphen.Word, Serializable

This class represents a hyphenated word.

See Also:
Serialized Form

Method Summary
 char charAt(int index)
           
static int convertLiangToWeight(int liangValue)
          Converts the raw value from the Liang data to a weighted value.
 int getLiangWeight(org.axsl.hyphen.HyphenationFilter filter, int virtualArrayIndex)
           
 org.axsl.hyphen.MutatingHyphenationBreak getMutatingBreak(org.axsl.hyphen.HyphenationFilter filter, int pointIndex)
           
 CharSequence getNormalizedWord()
           
 int getOffset(org.axsl.hyphen.HyphenationFilter filter, int virtualArrayIndex)
           
 char getSegmentChar(org.axsl.hyphen.HyphenationFilter filter, int layoutOptionIndex, int segmentIndex, int charIndex)
           
 int getSegmentLength(org.axsl.hyphen.HyphenationFilter filter, int layoutOptionIndex, int segmentIndex)
           
 int getWeight(org.axsl.hyphen.HyphenationFilter filter, int pointIndex)
           
 int length()
           
static String normalizeException(String exceptionWord, char hyphenationChar)
          Takes exception input like "oblig-a-tory" and converts it to the unhyphenated equivalent, that is "obligatory", so that it can be used for searches on input words.
 int qtyHyphenationPoints(org.axsl.hyphen.HyphenationFilter filter)
           
 int qtyLayoutOptions(org.axsl.hyphen.HyphenationFilter filter)
           
 int qtySegments(org.axsl.hyphen.HyphenationFilter filter, int layoutOptionIndex)
           
 CharSequence subSequence(int start, int end)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getOffset

public int getOffset(org.axsl.hyphen.HyphenationFilter filter,
                     int virtualArrayIndex)
Specified by:
getOffset in interface org.axsl.hyphen.Word

getLiangWeight

public int getLiangWeight(org.axsl.hyphen.HyphenationFilter filter,
                          int virtualArrayIndex)
Specified by:
getLiangWeight in interface org.axsl.hyphen.Word

getWeight

public int getWeight(org.axsl.hyphen.HyphenationFilter filter,
                     int pointIndex)
Specified by:
getWeight in interface org.axsl.hyphen.Word

toString

public String toString()
Specified by:
toString in interface CharSequence
Overrides:
toString in class Object

convertLiangToWeight

public static int convertLiangToWeight(int liangValue)
Converts the raw value from the Liang data to a weighted value. In the Liang system, 1) even values are negative, 2) odd values are positive, and the magnitude of the number conveys the magnitude of the direction.

Parameters:
liangValue - Any positive byte value that contains a Liang-style algorithm weight. (Liang input is only in the range 0 to 5, but we will handle any positive input).
Returns:
A value that reflects the numeric weight of the raw Liang value.

getMutatingBreak

public org.axsl.hyphen.MutatingHyphenationBreak getMutatingBreak(org.axsl.hyphen.HyphenationFilter filter,
                                                                 int pointIndex)
Specified by:
getMutatingBreak in interface org.axsl.hyphen.Word

normalizeException

public static String normalizeException(String exceptionWord,
                                        char hyphenationChar)
Takes exception input like "oblig-a-tory" and converts it to the unhyphenated equivalent, that is "obligatory", so that it can be used for searches on input words.

Parameters:
exceptionWord - The hyphenated exception.
hyphenationChar - The character used in the exception to signify a hyphenation opportunity. This may be different from the character used to show the hyphenation point in the output.
Returns:
The unhyphenated equivalent of exceptionWord.

qtyHyphenationPoints

public int qtyHyphenationPoints(org.axsl.hyphen.HyphenationFilter filter)
Specified by:
qtyHyphenationPoints in interface org.axsl.hyphen.Word

getNormalizedWord

public CharSequence getNormalizedWord()
Specified by:
getNormalizedWord in interface org.axsl.hyphen.Word

qtyLayoutOptions

public int qtyLayoutOptions(org.axsl.hyphen.HyphenationFilter filter)
Specified by:
qtyLayoutOptions in interface org.axsl.hyphen.Word

qtySegments

public int qtySegments(org.axsl.hyphen.HyphenationFilter filter,
                       int layoutOptionIndex)
Specified by:
qtySegments in interface org.axsl.hyphen.Word

getSegmentLength

public int getSegmentLength(org.axsl.hyphen.HyphenationFilter filter,
                            int layoutOptionIndex,
                            int segmentIndex)
Specified by:
getSegmentLength in interface org.axsl.hyphen.Word

getSegmentChar

public char getSegmentChar(org.axsl.hyphen.HyphenationFilter filter,
                           int layoutOptionIndex,
                           int segmentIndex,
                           int charIndex)
Specified by:
getSegmentChar in interface org.axsl.hyphen.Word

length

public int length()
Specified by:
length in interface CharSequence

charAt

public char charAt(int index)
Specified by:
charAt in interface CharSequence

subSequence

public CharSequence subSequence(int start,
                                int end)
Specified by:
subSequence in interface CharSequence


Copyright © 2017. All rights reserved.