SimplemmaAnalyzer._normalize_word()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
"""Simplemma analyzer for Annif, based on simplemma lemmatizer."""
2
3
from __future__ import annotations
4
5
import annif.simplemma_util
6
7
from . import analyzer
8
9
10
class SimplemmaAnalyzer(analyzer.Analyzer):
11
    name = "simplemma"
12
13
    def __init__(self, param: str, **kwargs) -> None:
14
        self.lang = param
15
        super().__init__(**kwargs)
16
17
    def _normalize_word(self, word: str) -> str:
18
        return annif.simplemma_util.lemmatizer.lemmatize(word, lang=self.lang)
19