Skip to content

Commit

Permalink
Update meta_tagger.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadForouhesh authored Mar 9, 2022
1 parent fd53adc commit 7f09d29
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crf_pos/pos_tagger/meta_tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from typing import Union, List, Any, Tuple, Generator
from crf_pos.normalization.normalizer import Normalizer
from crf_pos.normalization.tokenizer import tokenize_words


class MetaTagger:
Expand All @@ -29,7 +28,7 @@ def __getitem__(self, item: Union[list, str]) -> List[Tuple[str, str]]:
:param item: An input text/list, the preferred input type is string.
:return: A List of tuples including a word and its part of speech.
"""
if isinstance(item, str): item = tokenize_words(self.norm.normalize(item))
if isinstance(item, str): item = self.norm.normalize(item)
return self.parse([item])[0]

## ToDo get_resources.
Expand Down

0 comments on commit 7f09d29

Please sign in to comment.