maha.parsers.rules.common#

Module Contents#

Functions#

get_fractions_of_unit_pattern(unit)

Returns the fractions of a unit pattern.

get_fractions_of_pattern(pattern)

Returns the fractions of a pattern.

wrap_pattern(pattern)

Adds start and end expression to the pattern.

spaced_patterns(*patterns)

Returns a regex pattern that matches any of the given patterns, separated by spaces.

Attributes#

THIRD

Pattern that matches the pronunciation of third in Arabic

QUARTER

Pattern that matches the pronunciation of quarter in Arabic

HALF

Pattern that matches the pronunciation of half in Arabic

THREE_QUARTERS

Pattern that matches the pronunciation of three quarters in Arabic

WAW_CONNECTOR

Pattern that matches WAW as a connector between two words

WORD_SEPARATOR

Pattern that matches the word separator between numerals in Arabic

ALL_ALEF

Pattern that matches all possible forms of the ALEF in Arabic

TWO_SUFFIX

Pattern that matches the two-suffix of words in Arabic

SUM_SUFFIX

Pattern that matches the sum-suffix of words in Arabic

EXPRESSION_START

Pattern that matches the start of a rule expression in Arabic

EXPRESSION_END

Pattern that matches the end of a rule expression in Arabic

FRACTIONS

TEH_OPTIONAL_SUFFIX

AFTER

BEFORE

PREVIOUS

NEXT

AFTER_NEXT

BEFORE_PREVIOUS

IN_FROM_AT

FROM

TO

get_fractions_of_unit_pattern(unit)[source]#

Returns the fractions of a unit pattern.

Parameters

unit (str) – The unit pattern.

Returns

Pattern for the fractions of the unit.

Return type

str

get_fractions_of_pattern(pattern)[source]#

Returns the fractions of a pattern.

Parameters

pattern (str) – The pattern.

Returns

Pattern for the fractions of the input pattern.

Return type

str

wrap_pattern(pattern)[source]#

Adds start and end expression to the pattern.

Parameters

pattern (str) –

Return type

str

spaced_patterns(*patterns)[source]#

Returns a regex pattern that matches any of the given patterns, separated by spaces.

Parameters

patterns – The patterns to match.

Return type

str

THIRD[source]#

Pattern that matches the pronunciation of third in Arabic

QUARTER[source]#

Pattern that matches the pronunciation of quarter in Arabic

HALF[source]#

Pattern that matches the pronunciation of half in Arabic

THREE_QUARTERS[source]#

Pattern that matches the pronunciation of three quarters in Arabic

WAW_CONNECTOR[source]#

Pattern that matches WAW as a connector between two words

WORD_SEPARATOR[source]#

Pattern that matches the word separator between numerals in Arabic

ALL_ALEF[source]#

Pattern that matches all possible forms of the ALEF in Arabic

TWO_SUFFIX[source]#

Pattern that matches the two-suffix of words in Arabic

SUM_SUFFIX[source]#

Pattern that matches the sum-suffix of words in Arabic

EXPRESSION_START[source]#

Pattern that matches the start of a rule expression in Arabic

EXPRESSION_END[source]#

Pattern that matches the end of a rule expression in Arabic

FRACTIONS[source]#
TEH_OPTIONAL_SUFFIX = [ةه]?[source]#
AFTER[source]#
BEFORE[source]#
PREVIOUS[source]#
NEXT[source]#
AFTER_NEXT[source]#
BEFORE_PREVIOUS[source]#
IN_FROM_AT[source]#
FROM[source]#
TO[source]#