Class XmlSpellEngineDS

java.lang.Object
com.aquima.interactions.spellengine.ds.xml.parsing.XmlSpellEngineDS
All Implemented Interfaces:
ISpellEngineDS

public class XmlSpellEngineDS extends Object implements ISpellEngineDS
Spell engine datasource implementation that can be constructed with an XML resource.
Since:
6.0
Author:
Jon van Leuven
  • Constructor Details

    • XmlSpellEngineDS

      public XmlSpellEngineDS(IResource xmlResource)
      Construct a spell engine datasource with from an XML resource.
      Parameters:
      xmlResource - The xml resource.
  • Method Details

    • createDefault

      public static XmlSpellEngineDS createDefault(IResourceManager manager)

      This static method returns an XmlSpellEngineDS that reads its definitions from the classpath. (from spellengine/spell-engine.xml).

      The default spellers:
      • Spellers corresponding the ISO language codes: af, ba, bg, ca, cpe, cs, cy, da, de, el, en, eo, es, et, fa, fi, fr, fy, ga, gd, haw, hi, hu, id, is, it, ja, kl, kn, lisu, lt, ml, ms, ne, nl, pap, pl, pt, qu, ro, ru, si, sk, sl, sm, sq, sr, sus, sv, sw, th, tl, tr, vi, yi, yo, zh
      • Special spellers: roman (Roman integers), ordinal-nl (dutch ordinal numbers), ordinal-en (english ordinal numbers)
      Parameters:
      manager - Resource manager that is used for resource loading.
      Returns:
      The datasource implementation, never null.
      Throws:
      ResourceException - If the xml resource could not be found
    • iterateSpellers

      public void iterateSpellers(ISpellerVisitor visitor)
      Description copied from interface: ISpellEngineDS
      This method should iterate over the spellers and call the visitor for every speller.
      Specified by:
      iterateSpellers in interface ISpellEngineDS
      Parameters:
      visitor - The visitor used for every speller.