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-tools if 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 segment call 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:
Return type:

list[Chunk]