Class XmlSpellEngineDS
java.lang.Object
com.aquima.interactions.spellengine.ds.xml.parsing.XmlSpellEngineDS
- All Implemented Interfaces:
ISpellEngineDS
Spell engine datasource implementation that can be constructed with an XML resource.
- Since:
- 6.0
- Author:
- Jon van Leuven
-
Constructor Summary
ConstructorsConstructorDescriptionXmlSpellEngineDS
(IResource xmlResource) Construct a spell engine datasource with from an XML resource. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
XmlSpellEngineDS
Construct a spell engine datasource with from an XML resource.- Parameters:
xmlResource
- The xml resource.
-
-
Method Details
-
createDefault
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
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.
-