ArabicMorphologicalStrategy#
- class scikitplot.corpus.ArabicMorphologicalStrategy[source]#
Arabic and Hebrew morphological segmentation strategy.
Primary: camel-tools (
pip install camel-tools) for Arabic. Fallback: whitespace-word split (spaCy tokenisation not loaded here to keep the dependency chain minimal).For Hebrew the primary backend is
camel-toolsif the Hebrew lexicon is available; otherwise whitespace split.- Parameters:
- (none)
Notes
Developer note: camel-tools contains a MorphAnalyzer that also covers Ottoman Turkish. Load is deferred to first
segmentcall to keep__init__fast.- segment(span, config)[source]#
Segment Arabic/Hebrew span morphologically.
- Parameters:
- spanScriptSpan
Script span (Arabic or Hebrew).
- configWritingSystemAdapterConfig
Adapter configuration.
- Returns:
- list[Chunk]
Morpheme or word chunks.
- Parameters:
span (ScriptSpan)
config (WritingSystemAdapterConfig)
- Return type: