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 Summary
Constructors Constructor Description XmlSpellEngineDS(IResource xmlResource)
Construct a spell engine datasource with from an xml resource.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XmlSpellEngineDS
createDefault(IResourceManager manager)
This static method returns an XmlSpellEngineDS that reads its definitions from the classpath.void
iterateSpellers(ISpellerVisitor visitor)
This method should iterate over the spellers and call the visitor for every speller.
-
-
-
Constructor Detail
-
XmlSpellEngineDS
public XmlSpellEngineDS(IResource xmlResource)
Construct a spell engine datasource with from an xml resource.- Parameters:
xmlResource
- The xml resource.
-
-
Method Detail
-
createDefault
public static XmlSpellEngineDS createDefault(IResourceManager manager) throws ResourceException
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) throws InitializationException
Description copied from interface:ISpellEngineDS
This method should iterate over the spellers and call the visitor for every speller.- Specified by:
iterateSpellers
in interfaceISpellEngineDS
- Parameters:
visitor
- The visitor used for every speller.- Throws:
InitializationException
- Is thrown when the spellers failed initialization.
-
-