Class SyllabifierLibrary

java.lang.Object
ca.phon.syllabifier.SyllabifierLibrary
All Implemented Interfaces:
IExtendable

public final class SyllabifierLibrary extends Object implements IExtendable
Class to help with loading syllabifiers.
  • Field Details

    • DEFAULT_SYLLABIFIER_LANG_PROP

      public static final String DEFAULT_SYLLABIFIER_LANG_PROP
  • Method Details

    • getInstance

      public static SyllabifierLibrary getInstance()
    • getLoader

      public ResourceLoader<Syllabifier> getLoader()
      Get syllabifier loader
      Returns:
      ResourceLoader<Syllabifier>
    • reloadDefinitions

      public void reloadDefinitions()
      Reload syllabifier definitions.
    • availableSyllabifiers

      public Iterator<Syllabifier> availableSyllabifiers()
      Return an Iterator for the available syllabifiers.
      Returns:
      iterator for the available syllabifiers
    • availableSyllabifierNames

      public List<String> availableSyllabifierNames()
      Get a list of available syllabifier names.
      Returns:
      list of names
    • availableSyllabifierLanguages

      public Set<Language> availableSyllabifierLanguages()
      Get a set of available syllabifier Languages
      Returns:
      set of language
    • getSyllabifierForLanguage

      public Syllabifier getSyllabifierForLanguage(String lang)
      Get the first available syllabifier for the given language.
      Parameters:
      lang - - should be one of the ISO 3-letter language codes
      Returns:
      the syllabifier if available, null otherwise
    • getSyllabifierForLanguage

      public Syllabifier getSyllabifierForLanguage(Language lang)
    • getSyllabifiersForLanguage

      public List<Syllabifier> getSyllabifiersForLanguage(String lang)
      Return all available syllabifiers for the given language.
      Parameters:
      ang - - should be one of the ISO 3-letter language codes
      Returns:
      the list of syllabifiers for the given language.
    • getSyllabifiersForLanguage

      public List<Syllabifier> getSyllabifiersForLanguage(Language lang)
    • getSyllabifierByName

      public Syllabifier getSyllabifierByName(String name)
      Get a syllabifier by name.
      Parameters:
      name -
      Returns:
      the named syllabifier or null
    • defaultSyllabifierLanguage

      public Language defaultSyllabifierLanguage()
      Default syllabifier language
      Returns:
      default syllabifier language
    • defaultSyllabifier

      public Syllabifier defaultSyllabifier()
    • getExtensions

      public Set<Class<?>> getExtensions()
      Description copied from interface: IExtendable
      Return all extension types supported
      Specified by:
      getExtensions in interface IExtendable
    • getExtension

      public <T> T getExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Get the requested extension if available.
      Specified by:
      getExtension in interface IExtendable
      Returns:
      the capability object or null if the cability is not available
    • putExtension

      public <T> T putExtension(Class<T> cap, T impl)
      Description copied from interface: IExtendable
      Add a new extension.
      Specified by:
      putExtension in interface IExtendable
      Parameters:
      cap - the extension to add
      Returns:
      the added extension implementation
    • removeExtension

      public <T> T removeExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Remove a capability.
      Specified by:
      removeExtension in interface IExtendable
      Parameters:
      cap - the capability to remove