-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbase.py
33 lines (23 loc) · 993 Bytes
/
base.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
"""Extensions to Abstract base classes in ``textblob.base``"""
from __future__ import absolute_import
from abc import ABCMeta, abstractmethod
# provide all base classes for ``textblob_de``
from textblob.blob import BaseBlob
from textblob.base import BaseNPExtractor, BaseParser
from textblob.base import BaseSentimentAnalyzer
from textblob.base import BaseTagger, BaseTokenizer
from textblob.base import DISCRETE, CONTINUOUS
# Testing phase - if found useful, this baseclass could be merged into
# textblob.base
##### LEMMATIZER #####
class BaseLemmatizer(metaclass=ABCMeta):
"""Abstract base class from which all Lemmatizer classes inherit.
Descendant classes must implement a ``lemmatize(text)`` method that returns
a WordList of Word object with updated lemma properties.
.. versionadded:: 0.2.3 (``textblob_de``)
"""
@abstractmethod
def lemmatize(self, text):
"""Return a list of (lemma, tag) tuples."""
return