edu.northwestern.at.morphadorner.corpuslinguistics.hyphenator

## Class BaseHyphenator

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.hyphenator.BaseHyphenator

- All Implemented Interfaces:
    Hyphenator
  Direct Known Subclasses:
    AmericanHyphenator, BritishHyphenator

      public class BaseHyphenator
      extends java.lang.Object
      implements Hyphenator

  BaseHyphenator: Hyphenates words using TeX rule sets.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected net.davidashen.text.Hyphenator` | `texHyphenator` The internal TeX-based hyphenator.
    `protected static java.lang.String` | `ukhyphenPath` UK Base hyphenation rules in TeX format.
    `protected static java.lang.String` | `ushyphenPath` US Base hyphenation rules in TeX format.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseHyphenator()` Create a base hyphenator using UK English rules.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `hyphenate(java.lang.String word)` Add hyphenation points to a single Base word.
    `void` | `loadHyphenationRules(java.io.InputStream hyphenRulesStream)` Load TeX format hyphenation rules from a stream.
    `void` | `loadHyphenationRules(java.lang.String hyphenRulesFileName)` Load TeX format hyphenation rules from a file.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### ukhyphenPath

          protected static java.lang.String ukhyphenPath

      UK Base hyphenation rules in TeX format.

    - #### ushyphenPath

          protected static java.lang.String ushyphenPath

      US Base hyphenation rules in TeX format.

    - #### texHyphenator

          protected net.davidashen.text.Hyphenator texHyphenator

      The internal TeX-based hyphenator.

  - ### Constructor Detail

    - #### BaseHyphenator

          public BaseHyphenator()

      Create a base hyphenator using UK English rules.

  - ### Method Detail

    - #### loadHyphenationRules

          public void loadHyphenationRules(java.io.InputStream hyphenRulesStream)
                                    throws java.lang.Exception

      Load TeX format hyphenation rules from a stream.
      Parameters:
        `hyphenRulesStream` - Stream with TeX format hyphenation rules.
      Throws:
        `java.lang.Exception`

    - #### loadHyphenationRules

          public void loadHyphenationRules(java.lang.String hyphenRulesFileName)
                                    throws java.lang.Exception

      Load TeX format hyphenation rules from a file.
      Parameters:
        `hyphenRulesFileName` - File with TeX format hyphenation rules.
      Throws:
        `java.lang.Exception`

    - #### hyphenate

          public java.lang.String hyphenate(java.lang.String word)

      Add hyphenation points to a single Base word.
      Specified by:
        `hyphenate` in interface `Hyphenator`
      Parameters:
        `word` - The word to hyphenate.
      Returns:
        The word with hyphenation points added.