1
2
3
4
5
6
7
8
9 """
10 Classes and interfaces for tagging each token of a sentence with
11 supplementary information, such as its part of speech. This task,
12 which is known as X{tagging}, is defined by the L{TaggerI} interface.
13 """
14
15 from api import *
16 from util import *
17 from simplify import *
18 from sequential import *
19 from brill import *
20
21 __all__ = [
22
23 'TaggerI',
24
25
26
27
28
29 'DefaultTagger', 'UnigramTagger', 'BigramTagger', 'TrigramTagger',
30 'NgramTagger', 'AffixTagger', 'RegexpTagger',
31
32
33 'BrillTagger', 'BrillTaggerTrainer', 'FastBrillTaggerTrainer',
34
35
36
37
38 'untag',
39 ]
40
41
42 try:
43 import numpy
44 from hmm import *
45 __all__ += ['HiddenMarkovModelTagger', 'HiddenMarkovModelTrainer',]
46
47 except ImportError:
48 pass
49
50
51
52
53
54 from nltk.internals import Deprecated
55 -class TagI(TaggerI, Deprecated):
56 """Use nltk.TaggerI instead."""
58 """Use nltk.SequentialBackoffTagger instead. Note: the methods
59 used to subclass SequentialBackoffTagger do not match those of
60 the old nltk.tag.SequentialBackoff; see the api docs for info."""
61 -class Ngram(SequentialBackoffTagger, Deprecated):
62 """Use nltk.NgramTagger instead. Note: NgramTagger.train() is now
63 a factory method."""
64 - def __init__(self, n, cutoff=1, backoff=None):
68 - def train(self, tagged_corpus, verbose=False):
74 """Use nltk.UnigramTagger instead."""
75 - def __init__(self, cutoff=1, backoff=None):
77 -class Bigram(Ngram, Deprecated):
78 """Use nltk.BigramTagger instead."""
79 - def __init__(self, cutoff=1, backoff=None):
82 """Use nltk.TrigramTagger instead."""
83 - def __init__(self, cutoff=1, backoff=None):
85 -class Affix(SequentialBackoffTagger, Deprecated):
86 """Use nltk.AffixTagger instead."""
87 - def __init__(self, length, minlength, backoff=None):
92 - def train(self, tagged_corpus):
97 -class Lookup(UnigramTagger, Deprecated):
98 """Use UnigramTagger instead."""
99 -class Regexp(RegexpTagger, Deprecated):
100 """Use RegexpTagger instead."""
101