estnltk.grammar.grammar module

class estnltk.grammar.grammar.AllGaps(*symbols, **kwargs)[source]

Concatenate symbols, but allow gaps of any size between the symbols.

Attributes

name The name of the symbol.
symbols

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)
class estnltk.grammar.grammar.Concatenation(*symbols, **kwargs)[source]

Concatenate symbols.

Attributes

name The name of the symbol.
symbols

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)
class estnltk.grammar.grammar.IRegex(pattern, flags=42, name=None)[source]

Case insensitive regular expression symbol.

Attributes

name The name of the symbol.
pattern

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)
class estnltk.grammar.grammar.Intersection(*symbols, **kwargs)[source]

Symbol that intersects two different symbols.

Attributes

name The name of the symbol.
symbols

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)
class estnltk.grammar.grammar.Layer(layer_name, **kwargs)[source]

Symbol that matches elements of given layer.

Attributes

layer_name
name The name of the symbol.

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)
class estnltk.grammar.grammar.LayerRegex(layer_name, regex, **kwargs)[source]

Symbol that matches regular expressions on texts of the given layer.

Attributes

layer_name
name The name of the symbol.
regex

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)
class estnltk.grammar.grammar.Lemmas(*lemmas, **kwargs)[source]

Symbol that matches a list of lemmas.

Attributes

lemmas
name The name of the symbol.
pattern

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)
class estnltk.grammar.grammar.Postags(*postags, **kwargs)[source]

Symbol that matches a list of part-of-speech tags.

Attributes

name The name of the symbol.
pattern
postags

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)
class estnltk.grammar.grammar.Regex(pattern, flags=40, name=None)[source]

Regular expression symbol.

Attributes

name The name of the symbol.
pattern

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)
class estnltk.grammar.grammar.Suffix(suffix, **kwargs)[source]

Symbol that matches word suffixes.

Attributes

name The name of the symbol.
suffix

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)
class estnltk.grammar.grammar.Symbol(name=None)[source]

Base symbol for the grammar.

Attributes

name The name of the symbol.

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)
get_matches(text, cache=None, conflict_resolver=<function resolve_using_maximal_coverage>)[source]

Get the matches of the symbol on given text.

name

The name of the symbol. If there is no name, this is None

class estnltk.grammar.grammar.Union(*symbols, **kwargs)[source]

Symbol that unions two other symbols.

Attributes

name The name of the symbol.
symbols

Methods

annotate(text[, conflict_resolver])
get_matches(text[, cache, conflict_resolver]) Get the matches of the symbol on given text.
get_matches_without_cache(text, \*\*env)