diff --git a/_modules/index.html b/_modules/index.html index 4031d31f..f492328e 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -110,7 +110,6 @@
# For license information, see LICENSE.TXT
import bisect
-
-# this unused import is for python 2.7
-from collections import Counter, defaultdict, deque
from functools import total_ordering
from itertools import chain, islice
@@ -173,7 +170,6 @@ Source code for nltk.collections
[docs]
def items(self):
- # returns iterator under python 3 and list under python 2
return zip(self.keys(), self.values())
@@ -233,7 +229,6 @@ Source code for nltk.collections
@@ -883,7 +878,7 @@ Source code for nltk.collections
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/collocations.html b/_modules/nltk/collocations.html
index 3786e477..8d6d4a84 100644
--- a/_modules/nltk/collocations.html
+++ b/_modules/nltk/collocations.html
@@ -568,7 +568,7 @@ Source code for nltk.collocations
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/compat.html b/_modules/nltk/compat.html
index 99d2327e..bdff52c4 100644
--- a/_modules/nltk/compat.html
+++ b/_modules/nltk/compat.html
@@ -161,7 +161,7 @@ Source code for nltk.compat
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus.html b/_modules/nltk/corpus.html
index 7e936b24..568d1558 100644
--- a/_modules/nltk/corpus.html
+++ b/_modules/nltk/corpus.html
@@ -656,7 +656,7 @@ Source code for nltk.corpus
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/aligned.html b/_modules/nltk/corpus/reader/aligned.html
index d486425b..33e4c382 100644
--- a/_modules/nltk/corpus/reader/aligned.html
+++ b/_modules/nltk/corpus/reader/aligned.html
@@ -295,7 +295,7 @@ Source code for nltk.corpus.reader.aligned
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/api.html b/_modules/nltk/corpus/reader/api.html
index 32927b50..5a5b7063 100644
--- a/_modules/nltk/corpus/reader/api.html
+++ b/_modules/nltk/corpus/reader/api.html
@@ -712,7 +712,7 @@ Source code for nltk.corpus.reader.api
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/bcp47.html b/_modules/nltk/corpus/reader/bcp47.html
index 39150e13..3dc45631 100644
--- a/_modules/nltk/corpus/reader/bcp47.html
+++ b/_modules/nltk/corpus/reader/bcp47.html
@@ -368,7 +368,7 @@ Source code for nltk.corpus.reader.bcp47
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/bnc.html b/_modules/nltk/corpus/reader/bnc.html
index dcc1a0df..3587c75c 100644
--- a/_modules/nltk/corpus/reader/bnc.html
+++ b/_modules/nltk/corpus/reader/bnc.html
@@ -424,7 +424,7 @@ Source code for nltk.corpus.reader.bnc
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/bracket_parse.html b/_modules/nltk/corpus/reader/bracket_parse.html
index 9a92a54b..a2465254 100644
--- a/_modules/nltk/corpus/reader/bracket_parse.html
+++ b/_modules/nltk/corpus/reader/bracket_parse.html
@@ -390,7 +390,7 @@ Source code for nltk.corpus.reader.bracket_parse
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/categorized_sents.html b/_modules/nltk/corpus/reader/categorized_sents.html
index 1d6882db..d3ba4006 100644
--- a/_modules/nltk/corpus/reader/categorized_sents.html
+++ b/_modules/nltk/corpus/reader/categorized_sents.html
@@ -297,7 +297,7 @@ Source code for nltk.corpus.reader.categorized_sents
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/chasen.html b/_modules/nltk/corpus/reader/chasen.html
index 7186a6b2..dda4d312 100644
--- a/_modules/nltk/corpus/reader/chasen.html
+++ b/_modules/nltk/corpus/reader/chasen.html
@@ -310,7 +310,7 @@ Source code for nltk.corpus.reader.chasen
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/childes.html b/_modules/nltk/corpus/reader/childes.html
index 417465c3..2b09149c 100644
--- a/_modules/nltk/corpus/reader/childes.html
+++ b/_modules/nltk/corpus/reader/childes.html
@@ -786,7 +786,7 @@ Source code for nltk.corpus.reader.childes
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/chunked.html b/_modules/nltk/corpus/reader/chunked.html
index cad07d14..54bbc5ea 100644
--- a/_modules/nltk/corpus/reader/chunked.html
+++ b/_modules/nltk/corpus/reader/chunked.html
@@ -432,7 +432,7 @@ Source code for nltk.corpus.reader.chunked
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/cmudict.html b/_modules/nltk/corpus/reader/cmudict.html
index a6792a4f..e0d05d63 100644
--- a/_modules/nltk/corpus/reader/cmudict.html
+++ b/_modules/nltk/corpus/reader/cmudict.html
@@ -220,7 +220,7 @@ Source code for nltk.corpus.reader.cmudict
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/comparative_sents.html b/_modules/nltk/corpus/reader/comparative_sents.html
index 25b436ba..5765d69a 100644
--- a/_modules/nltk/corpus/reader/comparative_sents.html
+++ b/_modules/nltk/corpus/reader/comparative_sents.html
@@ -453,7 +453,7 @@ Source code for nltk.corpus.reader.comparative_sents
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/conll.html b/_modules/nltk/corpus/reader/conll.html
index 5fee8e2e..5e052b3f 100644
--- a/_modules/nltk/corpus/reader/conll.html
+++ b/_modules/nltk/corpus/reader/conll.html
@@ -759,7 +759,7 @@ Source code for nltk.corpus.reader.conll
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/crubadan.html b/_modules/nltk/corpus/reader/crubadan.html
index d7712599..c1b10c0a 100644
--- a/_modules/nltk/corpus/reader/crubadan.html
+++ b/_modules/nltk/corpus/reader/crubadan.html
@@ -241,7 +241,7 @@ Source code for nltk.corpus.reader.crubadan
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/dependency.html b/_modules/nltk/corpus/reader/dependency.html
index 211c0628..9f9b4c1c 100644
--- a/_modules/nltk/corpus/reader/dependency.html
+++ b/_modules/nltk/corpus/reader/dependency.html
@@ -262,7 +262,7 @@ Source code for nltk.corpus.reader.dependency
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/framenet.html b/_modules/nltk/corpus/reader/framenet.html
index 8c72f4b5..0339b614 100644
--- a/_modules/nltk/corpus/reader/framenet.html
+++ b/_modules/nltk/corpus/reader/framenet.html
@@ -3683,7 +3683,7 @@ Source code for nltk.corpus.reader.framenet
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/ieer.html b/_modules/nltk/corpus/reader/ieer.html
index acbd6d10..9b455aad 100644
--- a/_modules/nltk/corpus/reader/ieer.html
+++ b/_modules/nltk/corpus/reader/ieer.html
@@ -248,7 +248,7 @@ Source code for nltk.corpus.reader.ieer
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/indian.html b/_modules/nltk/corpus/reader/indian.html
index 6198a6d8..36e6a273 100644
--- a/_modules/nltk/corpus/reader/indian.html
+++ b/_modules/nltk/corpus/reader/indian.html
@@ -234,7 +234,7 @@ Source code for nltk.corpus.reader.indian
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/ipipan.html b/_modules/nltk/corpus/reader/ipipan.html
index bbaff042..b3b1e080 100644
--- a/_modules/nltk/corpus/reader/ipipan.html
+++ b/_modules/nltk/corpus/reader/ipipan.html
@@ -516,7 +516,7 @@ Source code for nltk.corpus.reader.ipipan
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/knbc.html b/_modules/nltk/corpus/reader/knbc.html
index 6e6a4d7e..3f8a6485 100644
--- a/_modules/nltk/corpus/reader/knbc.html
+++ b/_modules/nltk/corpus/reader/knbc.html
@@ -315,7 +315,7 @@ Source code for nltk.corpus.reader.knbc
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/lin.html b/_modules/nltk/corpus/reader/lin.html
index 9d3ce86b..824f912c 100644
--- a/_modules/nltk/corpus/reader/lin.html
+++ b/_modules/nltk/corpus/reader/lin.html
@@ -318,7 +318,7 @@ Source code for nltk.corpus.reader.lin
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/markdown.html b/_modules/nltk/corpus/reader/markdown.html
index a16300ea..c4ef1f1e 100644
--- a/_modules/nltk/corpus/reader/markdown.html
+++ b/_modules/nltk/corpus/reader/markdown.html
@@ -560,7 +560,7 @@ Source code for nltk.corpus.reader.markdown
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/mte.html b/_modules/nltk/corpus/reader/mte.html
index 627aa8de..11398e1f 100644
--- a/_modules/nltk/corpus/reader/mte.html
+++ b/_modules/nltk/corpus/reader/mte.html
@@ -599,7 +599,7 @@ Source code for nltk.corpus.reader.mte
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/nkjp.html b/_modules/nltk/corpus/reader/nkjp.html
index cc5de20f..7b258a77 100644
--- a/_modules/nltk/corpus/reader/nkjp.html
+++ b/_modules/nltk/corpus/reader/nkjp.html
@@ -714,7 +714,7 @@ Source code for nltk.corpus.reader.nkjp
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/nombank.html b/_modules/nltk/corpus/reader/nombank.html
index 52a04603..93d07a60 100644
--- a/_modules/nltk/corpus/reader/nombank.html
+++ b/_modules/nltk/corpus/reader/nombank.html
@@ -651,7 +651,7 @@ Source code for nltk.corpus.reader.nombank
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/nps_chat.html b/_modules/nltk/corpus/reader/nps_chat.html
index ec89c269..802bf7a6 100644
--- a/_modules/nltk/corpus/reader/nps_chat.html
+++ b/_modules/nltk/corpus/reader/nps_chat.html
@@ -228,7 +228,7 @@ Source code for nltk.corpus.reader.nps_chat
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/opinion_lexicon.html b/_modules/nltk/corpus/reader/opinion_lexicon.html
index 7e772b10..67de5eba 100644
--- a/_modules/nltk/corpus/reader/opinion_lexicon.html
+++ b/_modules/nltk/corpus/reader/opinion_lexicon.html
@@ -260,7 +260,7 @@ Source code for nltk.corpus.reader.opinion_lexicon
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/panlex_lite.html b/_modules/nltk/corpus/reader/panlex_lite.html
index 8c95dc88..8771bfeb 100644
--- a/_modules/nltk/corpus/reader/panlex_lite.html
+++ b/_modules/nltk/corpus/reader/panlex_lite.html
@@ -327,7 +327,7 @@ Source code for nltk.corpus.reader.panlex_lite
Source code for nltk.corpus.reader.panlex_swadesh
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/pl196x.html b/_modules/nltk/corpus/reader/pl196x.html
index ad760b49..88107eb0 100644
--- a/_modules/nltk/corpus/reader/pl196x.html
+++ b/_modules/nltk/corpus/reader/pl196x.html
@@ -532,7 +532,7 @@ Source code for nltk.corpus.reader.pl196x
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/plaintext.html b/_modules/nltk/corpus/reader/plaintext.html
index 478c419d..a53adee3 100644
--- a/_modules/nltk/corpus/reader/plaintext.html
+++ b/_modules/nltk/corpus/reader/plaintext.html
@@ -382,7 +382,7 @@ Source code for nltk.corpus.reader.plaintext
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/ppattach.html b/_modules/nltk/corpus/reader/ppattach.html
index 13da0665..216a6d44 100644
--- a/_modules/nltk/corpus/reader/ppattach.html
+++ b/_modules/nltk/corpus/reader/ppattach.html
@@ -227,7 +227,7 @@ Source code for nltk.corpus.reader.ppattach
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/propbank.html b/_modules/nltk/corpus/reader/propbank.html
index de116e7e..8c8e150f 100644
--- a/_modules/nltk/corpus/reader/propbank.html
+++ b/_modules/nltk/corpus/reader/propbank.html
@@ -714,7 +714,7 @@ Source code for nltk.corpus.reader.propbank
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/pros_cons.html b/_modules/nltk/corpus/reader/pros_cons.html
index b166b848..90aaa475 100644
--- a/_modules/nltk/corpus/reader/pros_cons.html
+++ b/_modules/nltk/corpus/reader/pros_cons.html
@@ -262,7 +262,7 @@ Source code for nltk.corpus.reader.pros_cons
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/reviews.html b/_modules/nltk/corpus/reader/reviews.html
index 88c9e889..e40a3498 100644
--- a/_modules/nltk/corpus/reader/reviews.html
+++ b/_modules/nltk/corpus/reader/reviews.html
@@ -487,7 +487,7 @@ Source code for nltk.corpus.reader.reviews
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/rte.html b/_modules/nltk/corpus/reader/rte.html
index 3eef38f3..47bc2345 100644
--- a/_modules/nltk/corpus/reader/rte.html
+++ b/_modules/nltk/corpus/reader/rte.html
@@ -278,7 +278,7 @@ Source code for nltk.corpus.reader.rte
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/semcor.html b/_modules/nltk/corpus/reader/semcor.html
index 617ca324..8ac86f7d 100644
--- a/_modules/nltk/corpus/reader/semcor.html
+++ b/_modules/nltk/corpus/reader/semcor.html
@@ -458,7 +458,7 @@ Source code for nltk.corpus.reader.semcor
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/senseval.html b/_modules/nltk/corpus/reader/senseval.html
index 1d0225f5..85fdd8ce 100644
--- a/_modules/nltk/corpus/reader/senseval.html
+++ b/_modules/nltk/corpus/reader/senseval.html
@@ -334,7 +334,7 @@ Source code for nltk.corpus.reader.senseval
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/sentiwordnet.html b/_modules/nltk/corpus/reader/sentiwordnet.html
index 151b9bc6..ff9aa2b4 100644
--- a/_modules/nltk/corpus/reader/sentiwordnet.html
+++ b/_modules/nltk/corpus/reader/sentiwordnet.html
@@ -283,7 +283,7 @@ Source code for nltk.corpus.reader.sentiwordnet
<
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/sinica_treebank.html b/_modules/nltk/corpus/reader/sinica_treebank.html
index 16803a39..16b15b16 100644
--- a/_modules/nltk/corpus/reader/sinica_treebank.html
+++ b/_modules/nltk/corpus/reader/sinica_treebank.html
@@ -195,7 +195,7 @@ Source code for nltk.corpus.reader.sinica_treebank
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/string_category.html b/_modules/nltk/corpus/reader/string_category.html
index cae17bd8..a1e702ab 100644
--- a/_modules/nltk/corpus/reader/string_category.html
+++ b/_modules/nltk/corpus/reader/string_category.html
@@ -182,7 +182,7 @@ Source code for nltk.corpus.reader.string_category
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/switchboard.html b/_modules/nltk/corpus/reader/switchboard.html
index e1d717ff..d3ae359d 100644
--- a/_modules/nltk/corpus/reader/switchboard.html
+++ b/_modules/nltk/corpus/reader/switchboard.html
@@ -272,7 +272,7 @@ Source code for nltk.corpus.reader.switchboard
Source code for nltk.corpus.reader.tagged
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/timit.html b/_modules/nltk/corpus/reader/timit.html
index b82c5a5e..2c16dd00 100644
--- a/_modules/nltk/corpus/reader/timit.html
+++ b/_modules/nltk/corpus/reader/timit.html
@@ -696,7 +696,7 @@ Source code for nltk.corpus.reader.timit
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/toolbox.html b/_modules/nltk/corpus/reader/toolbox.html
index a0f14dd5..adb1e3f5 100644
--- a/_modules/nltk/corpus/reader/toolbox.html
+++ b/_modules/nltk/corpus/reader/toolbox.html
@@ -211,7 +211,7 @@ Source code for nltk.corpus.reader.toolbox
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/twitter.html b/_modules/nltk/corpus/reader/twitter.html
index fba6fe67..e2420501 100644
--- a/_modules/nltk/corpus/reader/twitter.html
+++ b/_modules/nltk/corpus/reader/twitter.html
@@ -268,7 +268,7 @@ Source code for nltk.corpus.reader.twitter
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/udhr.html b/_modules/nltk/corpus/reader/udhr.html
index 2cdadcb6..63df4fdc 100644
--- a/_modules/nltk/corpus/reader/udhr.html
+++ b/_modules/nltk/corpus/reader/udhr.html
@@ -197,7 +197,7 @@ Source code for nltk.corpus.reader.udhr
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/util.html b/_modules/nltk/corpus/reader/util.html
index ccf0e041..ddd1e451 100644
--- a/_modules/nltk/corpus/reader/util.html
+++ b/_modules/nltk/corpus/reader/util.html
@@ -954,7 +954,7 @@ Source code for nltk.corpus.reader.util
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/verbnet.html b/_modules/nltk/corpus/reader/verbnet.html
index 6397e609..9a894c65 100644
--- a/_modules/nltk/corpus/reader/verbnet.html
+++ b/_modules/nltk/corpus/reader/verbnet.html
@@ -797,7 +797,7 @@ Source code for nltk.corpus.reader.verbnet
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/wordlist.html b/_modules/nltk/corpus/reader/wordlist.html
index a54ac76b..2ea84b69 100644
--- a/_modules/nltk/corpus/reader/wordlist.html
+++ b/_modules/nltk/corpus/reader/wordlist.html
@@ -313,7 +313,7 @@ Source code for nltk.corpus.reader.wordlist
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/wordnet.html b/_modules/nltk/corpus/reader/wordnet.html
index 3b166574..15f9a9bc 100644
--- a/_modules/nltk/corpus/reader/wordnet.html
+++ b/_modules/nltk/corpus/reader/wordnet.html
@@ -772,7 +772,7 @@ Source code for nltk.corpus.reader.wordnet
(from 'animal.n.01' to 'entity.n.01'):
>>> dog = wn.synset('dog.n.01')
- >>> hyp = lambda s:s.hypernyms()
+ >>> hyp = lambda s:sorted(s.hypernyms())
>>> print(list(dog.closure(hyp)))
[Synset('canine.n.02'), Synset('domestic_animal.n.01'), Synset('carnivore.n.01'),\
Synset('animal.n.01'), Synset('placental.n.01'), Synset('organism.n.01'),\
@@ -806,7 +806,7 @@ Source code for nltk.corpus.reader.wordnet
>>> from nltk.corpus import wordnet as wn
>>> from pprint import pprint
>>> computer = wn.synset('computer.n.01')
- >>> topic = lambda s:s.topic_domains()
+ >>> topic = lambda s:sorted(s.topic_domains())
>>> pprint(computer.tree(topic))
[Synset('computer.n.01'), [Synset('computer_science.n.01')]]
@@ -816,7 +816,7 @@ Source code for nltk.corpus.reader.wordnet
But keep duplicate branches (from 'animal.n.01' to 'entity.n.01'):
>>> dog = wn.synset('dog.n.01')
- >>> hyp = lambda s:s.hypernyms()
+ >>> hyp = lambda s:sorted(s.hypernyms())
>>> pprint(dog.tree(hyp))
[Synset('dog.n.01'),
[Synset('canine.n.02'),
@@ -1684,6 +1684,7 @@ Source code for nltk.corpus.reader.wordnet
# map lemmas and parts of speech to synsets
self._lemma_pos_offset_map[lemma][pos] = synset_offsets
if pos == ADJ:
+ # Duplicate all adjectives indiscriminately?:
self._lemma_pos_offset_map[lemma][ADJ_SAT] = synset_offsets
def _load_exception_map(self):
@@ -2356,8 +2357,9 @@ Source code for nltk.corpus.reader.wordnet
"""
Find a possible base form for the given form, with the given
part of speech, by checking WordNet's list of exceptional
- forms, and by recursively stripping affixes for this part of
- speech until a form in WordNet is found.
+ forms, or by substituting suffixes for this part of speech.
+ If pos=None, try every part of speech until finding lemmas.
+ Return the first form found in WordNet, or eventually None.
>>> from nltk.corpus import wordnet as wn
>>> print(wn.morphy('dogs'))
@@ -2373,19 +2375,11 @@ Source code for nltk.corpus.reader.wordnet
book
>>> wn.morphy('book', wn.ADJ)
"""
-
- if pos is None:
- morphy = self._morphy
- analyses = chain(a for p in POS_LIST for a in morphy(form, p))
- else:
+ for pos in [pos] if pos else POS_LIST:
analyses = self._morphy(form, pos, check_exceptions)
-
- # get the first one we find
- first = list(islice(analyses, 1))
- if len(first) == 1:
- return first[0]
- else:
- return None
+ if analyses:
+ # Stop (don't try more parts of speech):
+ return analyses[0]
MORPHOLOGICAL_SUBSTITUTIONS = {
@@ -2421,8 +2415,7 @@ Source code for nltk.corpus.reader.wordnet
# Given an original string x
# 1. Apply rules once to the input to get y1, y2, y3, etc.
# 2. Return all that are in the database
- # 3. If there are no matches, keep applying rules until you either
- # find a match or you can't go any further
+ # (edited by ekaf) If there are no matches return an empty list.
exceptions = self._exception_map[pos]
substitutions = self.MORPHOLOGICAL_SUBSTITUTIONS[pos]
@@ -2446,28 +2439,15 @@ Source code for nltk.corpus.reader.wordnet
seen.add(form)
return result
- # 0. Check the exception lists
- if check_exceptions:
- if form in exceptions:
- return filter_forms([form] + exceptions[form])
-
- # 1. Apply rules once to the input to get y1, y2, y3, etc.
- forms = apply_rules([form])
+ if check_exceptions and form in exceptions:
+ # 0. Check the exception lists
+ forms = exceptions[form]
+ else:
+ # 1. Apply rules once to the input to get y1, y2, y3, etc.
+ forms = apply_rules([form])
# 2. Return all that are in the database (and check the original too)
- results = filter_forms([form] + forms)
- if results:
- return results
-
- # 3. If there are no matches, keep applying rules until we find a match
- while forms:
- forms = apply_rules(forms)
- results = filter_forms(forms)
- if results:
- return results
-
- # Return an empty list if we can't find anything
- return []
+ return filter_forms([form] + forms)
#############################################################
# Create information content from corpus
@@ -2910,7 +2890,7 @@ Source code for nltk.corpus.reader.wordnet
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/xmldocs.html b/_modules/nltk/corpus/reader/xmldocs.html
index 7acbf9ff..a5149a59 100644
--- a/_modules/nltk/corpus/reader/xmldocs.html
+++ b/_modules/nltk/corpus/reader/xmldocs.html
@@ -538,7 +538,7 @@ Source code for nltk.corpus.reader.xmldocs
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/reader/ycoe.html b/_modules/nltk/corpus/reader/ycoe.html
index 824312c9..9f337082 100644
--- a/_modules/nltk/corpus/reader/ycoe.html
+++ b/_modules/nltk/corpus/reader/ycoe.html
@@ -415,7 +415,7 @@ Source code for nltk.corpus.reader.ycoe
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/corpus/util.html b/_modules/nltk/corpus/util.html
index a8f7d02f..949b94ea 100644
--- a/_modules/nltk/corpus/util.html
+++ b/_modules/nltk/corpus/util.html
@@ -276,7 +276,7 @@ Source code for nltk.corpus.util
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/data.html b/_modules/nltk/data.html
index a52d1479..3b2ee5d5 100644
--- a/_modules/nltk/data.html
+++ b/_modules/nltk/data.html
@@ -101,6 +101,7 @@ Source code for nltk.data
#
# Copyright (C) 2001-2024 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
+# Author: ekaf (Restricting and switching pickles)
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
@@ -150,7 +151,6 @@ Source code for nltk.data
from zlib import Z_FINISH as FLUSH
from nltk import grammar, sem
-from nltk.compat import add_py3_data, py3_data
from nltk.internals import deprecated
textwrap_indent = functools.partial(textwrap.indent, prefix=" ")
@@ -414,7 +414,6 @@ Source code for nltk.data
[docs]
- @py3_data
def __init__(self, _path):
"""
Create a new path pointer for the given absolute path.
@@ -474,7 +473,6 @@ Source code for nltk.data
Python versions.
"""
- @py3_data
def __init__(
self, filename=None, mode=None, compresslevel=9, fileobj=None, **kwargs
):
@@ -513,7 +511,6 @@ Source code for nltk.data
which can be accessed by reading that zipfile.
"""
- @py3_data
def __init__(self, zipfile, entry=""):
"""
Create a new path pointer pointing at the specified entry
@@ -805,6 +802,73 @@ Source code for nltk.data
return RestrictedUnpickler(BytesIO(string)).load()
+def switch_punkt(lang="english"):
+ """
+ Return a pickle-free Punkt tokenizer instead of loading a pickle.
+
+ >>> import nltk
+ >>> tokenizer = nltk.data.load('tokenizers/punkt/english.pickle')
+ >>> print(tokenizer.tokenize("Hello! How are you?"))
+ ['Hello!', 'How are you?']
+ """
+ from nltk.tokenize import PunktTokenizer as tok
+
+ return tok(lang)
+
+
+def switch_chunker(fmt="multiclass"):
+ """
+ Return a pickle-free Named Entity Chunker instead of loading a pickle.
+
+ >>> import nltk
+ >>> from nltk.corpus import treebank
+ >>> from pprint import pprint
+ >>> chunker = nltk.data.load('chunkers/maxent_ne_chunker/PY3/english_ace_multiclass.pickle')
+ >>> pprint(chunker.parse(treebank.tagged_sents()[2][8:14])) # doctest: +NORMALIZE_WHITESPACE
+ Tree('S', [('chairman', 'NN'), ('of', 'IN'), Tree('ORGANIZATION', [('Consolidated', 'NNP'), ('Gold', 'NNP'), ('Fields', 'NNP')]), ('PLC', 'NNP')])
+
+ """
+ from nltk.chunk import ne_chunker
+
+ return ne_chunker(fmt)
+
+
+def switch_t_tagger():
+ """
+ Return a pickle-free Treebank Pos Tagger instead of loading a pickle.
+
+ >>> import nltk
+ >>> from nltk.tokenize import word_tokenize
+ >>> tagger = nltk.data.load('taggers/maxent_treebank_pos_tagger/PY3/english.pickle')
+ >>> print(tagger.tag(word_tokenize("Hello, how are you?")))
+ [('Hello', 'NNP'), (',', ','), ('how', 'WRB'), ('are', 'VBP'), ('you', 'PRP'), ('?', '.')]
+
+ """
+ from nltk.classify.maxent import maxent_pos_tagger
+
+ return maxent_pos_tagger()
+
+
+def switch_p_tagger(lang):
+ """
+ Return a pickle-free Averaged Perceptron Tagger instead of loading a pickle.
+
+ >>> import nltk
+ >>> from nltk.tokenize import word_tokenize
+ >>> tagger = nltk.data.load('taggers/averaged_perceptron_tagger/averaged_perceptron_tagger.pickle')
+ >>> print(tagger.tag(word_tokenize("Hello, how are you?")))
+ [('Hello', 'NNP'), (',', ','), ('how', 'WRB'), ('are', 'VBP'), ('you', 'PRP'), ('?', '.')]
+
+ """
+ from nltk.tag import _get_tagger
+
+ if lang == "ru":
+ lang = "rus"
+ else:
+ lang = None
+ return _get_tagger(lang)
+
+
[docs]
def load(
@@ -863,7 +927,6 @@ Source code for nltk.data
:param encoding: the encoding of the input; only used for text formats.
"""
resource_url = normalize_resource_url(resource_url)
- resource_url = add_py3_data(resource_url)
# Determine the format of the resource.
if format == "auto":
@@ -890,6 +953,21 @@ Source code for nltk.data
print(f"<<Using cached copy of {resource_url}>>")
return resource_val
+ protocol, path_ = split_resource_url(resource_url)
+
+ if path_[-7:] == ".pickle":
+ if verbose:
+ print(f"<<Loading pickle-free alternative to {resource_url}>>")
+ fil = os.path.split(path_[:-7])[-1]
+ if path_.startswith("tokenizers/punkt"):
+ return switch_punkt(fil)
+ elif path_.startswith("chunkers/maxent_ne_chunker"):
+ return switch_chunker(fil.split("_")[-1])
+ elif path_.startswith("taggers/maxent_treebank_pos_tagger"):
+ return switch_t_tagger()
+ elif path_.startswith("taggers/averaged_perceptron_tagger"):
+ return switch_p_tagger(fil.split("_")[-1])
+
# Let the user know what's going on.
if verbose:
print(f"<<Loading {resource_url}>>")
@@ -1044,9 +1122,9 @@ Source code for nltk.data
[docs]
class LazyLoader:
+
@@ -1093,7 +1171,6 @@ Source code for nltk.data
[docs]
- @py3_data
def __init__(self, filename):
if not isinstance(filename, str):
raise TypeError("ReopenableZipFile filename must be a string")
@@ -1165,7 +1242,6 @@ Source code for nltk.data
[docs]
- @py3_data
def __init__(self, stream, encoding, errors="strict"):
# Rewind the stream to its beginning.
stream.seek(0)
@@ -1671,7 +1747,7 @@ Source code for nltk.data
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/decorators.html b/_modules/nltk/decorators.html
index a99e8ebb..f6972ebd 100644
--- a/_modules/nltk/decorators.html
+++ b/_modules/nltk/decorators.html
@@ -377,7 +377,7 @@ Source code for nltk.decorators
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/downloader.html b/_modules/nltk/downloader.html
index 3a5b4a11..9a44b4f0 100644
--- a/_modules/nltk/downloader.html
+++ b/_modules/nltk/downloader.html
@@ -1530,7 +1530,7 @@ Source code for nltk.downloader
print(" Cancelled!")
else:
if not new_url.startswith(("http://", "https://")):
- new_url = "http://" + new_url
+ new_url = "https://" + new_url
try:
self._ds.url = new_url
except Exception as e:
@@ -2870,7 +2870,7 @@ Source code for nltk.downloader
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/draw/cfg.html b/_modules/nltk/draw/cfg.html
index c013ba61..4271ad39 100644
--- a/_modules/nltk/draw/cfg.html
+++ b/_modules/nltk/draw/cfg.html
@@ -1012,7 +1012,7 @@ Source code for nltk.draw.cfg
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/draw/dispersion.html b/_modules/nltk/draw/dispersion.html
index 80b52772..b5d63b1a 100644
--- a/_modules/nltk/draw/dispersion.html
+++ b/_modules/nltk/draw/dispersion.html
@@ -187,7 +187,7 @@ Source code for nltk.draw.dispersion
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/draw/table.html b/_modules/nltk/draw/table.html
index 81ce321e..0d31b75e 100644
--- a/_modules/nltk/draw/table.html
+++ b/_modules/nltk/draw/table.html
@@ -1460,7 +1460,7 @@ Source code for nltk.draw.table
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/draw/tree.html b/_modules/nltk/draw/tree.html
index fec6a6ff..49002834 100644
--- a/_modules/nltk/draw/tree.html
+++ b/_modules/nltk/draw/tree.html
@@ -1327,7 +1327,7 @@ Source code for nltk.draw.tree
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/draw/util.html b/_modules/nltk/draw/util.html
index 69e8efe6..fe393d6b 100644
--- a/_modules/nltk/draw/util.html
+++ b/_modules/nltk/draw/util.html
@@ -2986,7 +2986,7 @@ Source code for nltk.draw.util
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/featstruct.html b/_modules/nltk/featstruct.html
index 5a4b532d..9cc9e3a5 100644
--- a/_modules/nltk/featstruct.html
+++ b/_modules/nltk/featstruct.html
@@ -3040,7 +3040,7 @@ Source code for nltk.featstruct
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/grammar.html b/_modules/nltk/grammar.html
index 2348fd9e..8ebdacb4 100644
--- a/_modules/nltk/grammar.html
+++ b/_modules/nltk/grammar.html
@@ -1964,7 +1964,7 @@ Source code for nltk.grammar
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/help.html b/_modules/nltk/help.html
index e920822c..6ba81acb 100644
--- a/_modules/nltk/help.html
+++ b/_modules/nltk/help.html
@@ -195,7 +195,7 @@ Source code for nltk.help
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/inference/api.html b/_modules/nltk/inference/api.html
index 084cf6dd..e63640d4 100644
--- a/_modules/nltk/inference/api.html
+++ b/_modules/nltk/inference/api.html
@@ -920,7 +920,7 @@ Source code for nltk.inference.api
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/inference/discourse.html b/_modules/nltk/inference/discourse.html
index 997ef187..5a8d843d 100644
--- a/_modules/nltk/inference/discourse.html
+++ b/_modules/nltk/inference/discourse.html
@@ -867,7 +867,7 @@ Source code for nltk.inference.discourse
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/inference/mace.html b/_modules/nltk/inference/mace.html
index a55b54eb..0dea5a7e 100644
--- a/_modules/nltk/inference/mace.html
+++ b/_modules/nltk/inference/mace.html
@@ -533,7 +533,7 @@ Source code for nltk.inference.mace
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/inference/nonmonotonic.html b/_modules/nltk/inference/nonmonotonic.html
index 4861b990..592d9c38 100644
--- a/_modules/nltk/inference/nonmonotonic.html
+++ b/_modules/nltk/inference/nonmonotonic.html
@@ -747,7 +747,7 @@ Source code for nltk.inference.nonmonotonic
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/inference/prover9.html b/_modules/nltk/inference/prover9.html
index 82857d74..ecb8a9d6 100644
--- a/_modules/nltk/inference/prover9.html
+++ b/_modules/nltk/inference/prover9.html
@@ -690,7 +690,7 @@ Source code for nltk.inference.prover9
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/inference/resolution.html b/_modules/nltk/inference/resolution.html
index 862fb7a0..8c8d77df 100644
--- a/_modules/nltk/inference/resolution.html
+++ b/_modules/nltk/inference/resolution.html
@@ -966,7 +966,7 @@ Source code for nltk.inference.resolution
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/inference/tableau.html b/_modules/nltk/inference/tableau.html
index 282198b8..1c50b92e 100644
--- a/_modules/nltk/inference/tableau.html
+++ b/_modules/nltk/inference/tableau.html
@@ -898,7 +898,7 @@ Source code for nltk.inference.tableau
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/internals.html b/_modules/nltk/internals.html
index aa6f527d..8b0ee08c 100644
--- a/_modules/nltk/internals.html
+++ b/_modules/nltk/internals.html
@@ -1347,7 +1347,7 @@ Source code for nltk.internals
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/jsontags.html b/_modules/nltk/jsontags.html
index 3e5f224f..48f741c5 100644
--- a/_modules/nltk/jsontags.html
+++ b/_modules/nltk/jsontags.html
@@ -200,7 +200,7 @@ Source code for nltk.jsontags
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/langnames.html b/_modules/nltk/langnames.html
index d255693d..d4ef3ef5 100644
--- a/_modules/nltk/langnames.html
+++ b/_modules/nltk/langnames.html
@@ -868,7 +868,7 @@ Source code for nltk.langnames
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/lazyimport.html b/_modules/nltk/lazyimport.html
index 12383881..350366eb 100644
--- a/_modules/nltk/lazyimport.html
+++ b/_modules/nltk/lazyimport.html
@@ -260,7 +260,7 @@ Source code for nltk.lazyimport
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/lm/api.html b/_modules/nltk/lm/api.html
index 9aabdfac..e7257f57 100644
--- a/_modules/nltk/lm/api.html
+++ b/_modules/nltk/lm/api.html
@@ -397,7 +397,7 @@ Source code for nltk.lm.api
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/lm/counter.html b/_modules/nltk/lm/counter.html
index e6ed329e..677d4ac7 100644
--- a/_modules/nltk/lm/counter.html
+++ b/_modules/nltk/lm/counter.html
@@ -292,7 +292,7 @@ Source code for nltk.lm.counter
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/lm/models.html b/_modules/nltk/lm/models.html
index 4c64888a..13a92b26 100644
--- a/_modules/nltk/lm/models.html
+++ b/_modules/nltk/lm/models.html
@@ -315,7 +315,7 @@ Source code for nltk.lm.models
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/lm/preprocessing.html b/_modules/nltk/lm/preprocessing.html
index 70e81e09..6d57b3c6 100644
--- a/_modules/nltk/lm/preprocessing.html
+++ b/_modules/nltk/lm/preprocessing.html
@@ -174,7 +174,7 @@ Source code for nltk.lm.preprocessing
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/lm/smoothing.html b/_modules/nltk/lm/smoothing.html
index 70d5b14c..b109601d 100644
--- a/_modules/nltk/lm/smoothing.html
+++ b/_modules/nltk/lm/smoothing.html
@@ -280,7 +280,7 @@ Source code for nltk.lm.smoothing
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/lm/util.html b/_modules/nltk/lm/util.html
index dc5687fd..2cb73b58 100644
--- a/_modules/nltk/lm/util.html
+++ b/_modules/nltk/lm/util.html
@@ -139,7 +139,7 @@ Source code for nltk.lm.util
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/lm/vocabulary.html b/_modules/nltk/lm/vocabulary.html
index 9c7c4f3e..7841daf6 100644
--- a/_modules/nltk/lm/vocabulary.html
+++ b/_modules/nltk/lm/vocabulary.html
@@ -347,7 +347,7 @@ Source code for nltk.lm.vocabulary
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/metrics/agreement.html b/_modules/nltk/metrics/agreement.html
index a70b6e1c..00960ff6 100644
--- a/_modules/nltk/metrics/agreement.html
+++ b/_modules/nltk/metrics/agreement.html
@@ -647,7 +647,7 @@ Source code for nltk.metrics.agreement
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/metrics/aline.html b/_modules/nltk/metrics/aline.html
index fa3b2ee7..8e7937bc 100644
--- a/_modules/nltk/metrics/aline.html
+++ b/_modules/nltk/metrics/aline.html
@@ -1503,7 +1503,7 @@ Source code for nltk.metrics.aline
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/metrics/association.html b/_modules/nltk/metrics/association.html
index fe94c473..f9796732 100644
--- a/_modules/nltk/metrics/association.html
+++ b/_modules/nltk/metrics/association.html
@@ -650,7 +650,7 @@ Source code for nltk.metrics.association
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/metrics/confusionmatrix.html b/_modules/nltk/metrics/confusionmatrix.html
index 3fbc9c62..26db23d1 100644
--- a/_modules/nltk/metrics/confusionmatrix.html
+++ b/_modules/nltk/metrics/confusionmatrix.html
@@ -495,7 +495,7 @@ Source code for nltk.metrics.confusionmatrix
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/metrics/distance.html b/_modules/nltk/metrics/distance.html
index 65c23540..1610e54d 100644
--- a/_modules/nltk/metrics/distance.html
+++ b/_modules/nltk/metrics/distance.html
@@ -661,7 +661,7 @@ Source code for nltk.metrics.distance
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/metrics/paice.html b/_modules/nltk/metrics/paice.html
index 2f7a6d3f..fcd25aed 100644
--- a/_modules/nltk/metrics/paice.html
+++ b/_modules/nltk/metrics/paice.html
@@ -521,7 +521,7 @@ Source code for nltk.metrics.paice
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/metrics/scores.html b/_modules/nltk/metrics/scores.html
index 9d4d0749..3094c4f0 100644
--- a/_modules/nltk/metrics/scores.html
+++ b/_modules/nltk/metrics/scores.html
@@ -366,7 +366,7 @@ Source code for nltk.metrics.scores
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/metrics/segmentation.html b/_modules/nltk/metrics/segmentation.html
index 3b750b89..d71af1ce 100644
--- a/_modules/nltk/metrics/segmentation.html
+++ b/_modules/nltk/metrics/segmentation.html
@@ -348,7 +348,7 @@ Source code for nltk.metrics.segmentation
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/metrics/spearman.html b/_modules/nltk/metrics/spearman.html
index 489f5806..5ffaf679 100644
--- a/_modules/nltk/metrics/spearman.html
+++ b/_modules/nltk/metrics/spearman.html
@@ -194,7 +194,7 @@ Source code for nltk.metrics.spearman
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/misc/babelfish.html b/_modules/nltk/misc/babelfish.html
index cde4d1c0..63bbc353 100644
--- a/_modules/nltk/misc/babelfish.html
+++ b/_modules/nltk/misc/babelfish.html
@@ -130,7 +130,7 @@ Source code for nltk.misc.babelfish
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/misc/chomsky.html b/_modules/nltk/misc/chomsky.html
index 3f0a1667..bca12e03 100644
--- a/_modules/nltk/misc/chomsky.html
+++ b/_modules/nltk/misc/chomsky.html
@@ -254,7 +254,7 @@ Source code for nltk.misc.chomsky
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/misc/minimalset.html b/_modules/nltk/misc/minimalset.html
index b70babf5..25b97c9a 100644
--- a/_modules/nltk/misc/minimalset.html
+++ b/_modules/nltk/misc/minimalset.html
@@ -223,7 +223,7 @@ Source code for nltk.misc.minimalset
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/misc/sort.html b/_modules/nltk/misc/sort.html
index 37c04735..93eade62 100644
--- a/_modules/nltk/misc/sort.html
+++ b/_modules/nltk/misc/sort.html
@@ -308,7 +308,7 @@ Source code for nltk.misc.sort
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/misc/wordfinder.html b/_modules/nltk/misc/wordfinder.html
index 132c7a92..2db76da3 100644
--- a/_modules/nltk/misc/wordfinder.html
+++ b/_modules/nltk/misc/wordfinder.html
@@ -271,7 +271,7 @@ Source code for nltk.misc.wordfinder
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/api.html b/_modules/nltk/parse/api.html
index 6c5ffa33..e3d715eb 100644
--- a/_modules/nltk/parse/api.html
+++ b/_modules/nltk/parse/api.html
@@ -207,7 +207,7 @@ Source code for nltk.parse.api
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/bllip.html b/_modules/nltk/parse/bllip.html
index ed823763..3e5c044d 100644
--- a/_modules/nltk/parse/bllip.html
+++ b/_modules/nltk/parse/bllip.html
@@ -431,7 +431,7 @@ Source code for nltk.parse.bllip
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/chart.html b/_modules/nltk/parse/chart.html
index 5b8b5bc9..e1a6c4f8 100644
--- a/_modules/nltk/parse/chart.html
+++ b/_modules/nltk/parse/chart.html
@@ -2304,7 +2304,7 @@ Source code for nltk.parse.chart
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/corenlp.html b/_modules/nltk/parse/corenlp.html
index fb1f6c03..99ecda20 100644
--- a/_modules/nltk/parse/corenlp.html
+++ b/_modules/nltk/parse/corenlp.html
@@ -979,7 +979,7 @@ Source code for nltk.parse.corenlp
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/dependencygraph.html b/_modules/nltk/parse/dependencygraph.html
index 7b13bd2a..2d0e51ce 100644
--- a/_modules/nltk/parse/dependencygraph.html
+++ b/_modules/nltk/parse/dependencygraph.html
@@ -994,7 +994,7 @@ Source code for nltk.parse.dependencygraph
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/earleychart.html b/_modules/nltk/parse/earleychart.html
index 8d848826..ea1bf5c0 100644
--- a/_modules/nltk/parse/earleychart.html
+++ b/_modules/nltk/parse/earleychart.html
@@ -798,7 +798,7 @@ Source code for nltk.parse.earleychart
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/evaluate.html b/_modules/nltk/parse/evaluate.html
index d0a56995..e6aeaa10 100644
--- a/_modules/nltk/parse/evaluate.html
+++ b/_modules/nltk/parse/evaluate.html
@@ -255,7 +255,7 @@ Source code for nltk.parse.evaluate
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/featurechart.html b/_modules/nltk/parse/featurechart.html
index 81eaa663..4dde1b58 100644
--- a/_modules/nltk/parse/featurechart.html
+++ b/_modules/nltk/parse/featurechart.html
@@ -911,7 +911,7 @@ Source code for nltk.parse.featurechart
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/generate.html b/_modules/nltk/parse/generate.html
index 0ca162cc..d3a29a47 100644
--- a/_modules/nltk/parse/generate.html
+++ b/_modules/nltk/parse/generate.html
@@ -102,6 +102,7 @@ Source code for nltk.parse.generate
# Copyright (C) 2001-2024 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# Peter Ljunglöf <peter.ljunglof@heatherleaf.se>
+# Eric Kafe <kafe.eric@gmail.com>
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
#
@@ -127,7 +128,8 @@ Source code for nltk.parse.generate
if not start:
start = grammar.start()
if depth is None:
- depth = sys.maxsize
+ # Safe default, assuming the grammar may be recursive:
+ depth = (sys.getrecursionlimit() // 3) - 3
iter = _generate_all(grammar, [start], depth)
@@ -147,7 +149,8 @@ Source code for nltk.parse.generate
except RecursionError as error:
# Helpful error message while still showing the recursion stack.
raise RuntimeError(
- "The grammar has rule(s) that yield infinite recursion!"
+ "The grammar has rule(s) that yield infinite recursion!\n\
+Eventually use a lower 'depth', or a higher 'sys.setrecursionlimit()'."
) from error
else:
yield []
@@ -208,7 +211,7 @@ Source code for nltk.parse.generate
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/malt.html b/_modules/nltk/parse/malt.html
index 19ea220c..9b5153ee 100644
--- a/_modules/nltk/parse/malt.html
+++ b/_modules/nltk/parse/malt.html
@@ -540,7 +540,7 @@ Source code for nltk.parse.malt
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/nonprojectivedependencyparser.html b/_modules/nltk/parse/nonprojectivedependencyparser.html
index ef47f3dd..5ce235c6 100644
--- a/_modules/nltk/parse/nonprojectivedependencyparser.html
+++ b/_modules/nltk/parse/nonprojectivedependencyparser.html
@@ -976,7 +976,7 @@ Source code for nltk.parse.nonprojectivedependencyparser
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/pchart.html b/_modules/nltk/parse/pchart.html
index 96833663..308757d7 100644
--- a/_modules/nltk/parse/pchart.html
+++ b/_modules/nltk/parse/pchart.html
@@ -783,7 +783,7 @@ Source code for nltk.parse.pchart
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/projectivedependencyparser.html b/_modules/nltk/parse/projectivedependencyparser.html
index 6bc2fb2f..7a4dde21 100644
--- a/_modules/nltk/parse/projectivedependencyparser.html
+++ b/_modules/nltk/parse/projectivedependencyparser.html
@@ -893,7 +893,7 @@ Source code for nltk.parse.projectivedependencyparser
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/recursivedescent.html b/_modules/nltk/parse/recursivedescent.html
index 692c0231..c813cc55 100644
--- a/_modules/nltk/parse/recursivedescent.html
+++ b/_modules/nltk/parse/recursivedescent.html
@@ -870,7 +870,7 @@ Source code for nltk.parse.recursivedescent
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/shiftreduce.html b/_modules/nltk/parse/shiftreduce.html
index 8e381af7..a323c07b 100644
--- a/_modules/nltk/parse/shiftreduce.html
+++ b/_modules/nltk/parse/shiftreduce.html
@@ -652,7 +652,7 @@ Source code for nltk.parse.shiftreduce
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/stanford.html b/_modules/nltk/parse/stanford.html
index 117130ed..3054edbd 100644
--- a/_modules/nltk/parse/stanford.html
+++ b/_modules/nltk/parse/stanford.html
@@ -627,7 +627,7 @@ Source code for nltk.parse.stanford
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/transitionparser.html b/_modules/nltk/parse/transitionparser.html
index 850f1730..fa3b1179 100644
--- a/_modules/nltk/parse/transitionparser.html
+++ b/_modules/nltk/parse/transitionparser.html
@@ -952,7 +952,7 @@ Source code for nltk.parse.transitionparser
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/util.html b/_modules/nltk/parse/util.html
index 09f881db..144e6283 100644
--- a/_modules/nltk/parse/util.html
+++ b/_modules/nltk/parse/util.html
@@ -372,7 +372,7 @@ Source code for nltk.parse.util
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/parse/viterbi.html b/_modules/nltk/parse/viterbi.html
index 8316616b..c7bbebc4 100644
--- a/_modules/nltk/parse/viterbi.html
+++ b/_modules/nltk/parse/viterbi.html
@@ -588,7 +588,7 @@ Source code for nltk.parse.viterbi
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/probability.html b/_modules/nltk/probability.html
index 000a67b3..8cde7c0a 100644
--- a/_modules/nltk/probability.html
+++ b/_modules/nltk/probability.html
@@ -3067,7 +3067,7 @@ Source code for nltk.probability
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/boxer.html b/_modules/nltk/sem/boxer.html
index 5c49bd6a..650a7c8f 100644
--- a/_modules/nltk/sem/boxer.html
+++ b/_modules/nltk/sem/boxer.html
@@ -676,11 +676,15 @@ Source code for nltk.sem.boxer
else:
return None
self.assertToken(self.token(), ")")
+
+ def func_gen(x):
+ return lambda sent_index, word_indices: x
+
return [
lambda sent_index, word_indices: BoxerPred(
self.discourse_id, sent_index, word_indices, arg, tok, "n", 0
)
- ] + [lambda sent_index, word_indices: cond for cond in conds]
+ ] + [func_gen(cond) for cond in conds]
def _handle_date(self, arg):
# []: (+), []:'XXXX', [1004]:'04', []:'XX'
@@ -1986,7 +1990,7 @@ Source code for nltk.sem.boxer
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/chat80.html b/_modules/nltk/sem/chat80.html
index ddbef61f..78a8a360 100644
--- a/_modules/nltk/sem/chat80.html
+++ b/_modules/nltk/sem/chat80.html
@@ -1028,7 +1028,7 @@ Source code for nltk.sem.chat80
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/cooper_storage.html b/_modules/nltk/sem/cooper_storage.html
index 054decb0..de058312 100644
--- a/_modules/nltk/sem/cooper_storage.html
+++ b/_modules/nltk/sem/cooper_storage.html
@@ -256,7 +256,7 @@ Source code for nltk.sem.cooper_storage
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/drt.html b/_modules/nltk/sem/drt.html
index beb99c5d..0bb67894 100644
--- a/_modules/nltk/sem/drt.html
+++ b/_modules/nltk/sem/drt.html
@@ -1856,7 +1856,7 @@ Source code for nltk.sem.drt
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/drt_glue_demo.html b/_modules/nltk/sem/drt_glue_demo.html
index d9fad7ad..84dcbf98 100644
--- a/_modules/nltk/sem/drt_glue_demo.html
+++ b/_modules/nltk/sem/drt_glue_demo.html
@@ -712,7 +712,7 @@ Source code for nltk.sem.drt_glue_demo
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/evaluate.html b/_modules/nltk/sem/evaluate.html
index 2f7c7070..d5eb0623 100644
--- a/_modules/nltk/sem/evaluate.html
+++ b/_modules/nltk/sem/evaluate.html
@@ -1025,7 +1025,7 @@ Source code for nltk.sem.evaluate
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/glue.html b/_modules/nltk/sem/glue.html
index 1a03ca2f..6d81d54b 100644
--- a/_modules/nltk/sem/glue.html
+++ b/_modules/nltk/sem/glue.html
@@ -1081,7 +1081,7 @@ Source code for nltk.sem.glue
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/hole.html b/_modules/nltk/sem/hole.html
index 38002ed6..aa23886c 100644
--- a/_modules/nltk/sem/hole.html
+++ b/_modules/nltk/sem/hole.html
@@ -539,7 +539,7 @@ Source code for nltk.sem.hole
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/lfg.html b/_modules/nltk/sem/lfg.html
index 8c024bb2..e02d18d8 100644
--- a/_modules/nltk/sem/lfg.html
+++ b/_modules/nltk/sem/lfg.html
@@ -399,7 +399,7 @@ Source code for nltk.sem.lfg
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/linearlogic.html b/_modules/nltk/sem/linearlogic.html
index 9d93a45f..8b2e6fec 100644
--- a/_modules/nltk/sem/linearlogic.html
+++ b/_modules/nltk/sem/linearlogic.html
@@ -715,7 +715,7 @@ Source code for nltk.sem.linearlogic
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/logic.html b/_modules/nltk/sem/logic.html
index a2ae7a5b..88a1c2bc 100644
--- a/_modules/nltk/sem/logic.html
+++ b/_modules/nltk/sem/logic.html
@@ -2692,7 +2692,7 @@ Source code for nltk.sem.logic
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/relextract.html b/_modules/nltk/sem/relextract.html
index 8ad9cd41..572f9f28 100644
--- a/_modules/nltk/sem/relextract.html
+++ b/_modules/nltk/sem/relextract.html
@@ -698,7 +698,7 @@ Source code for nltk.sem.relextract
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/skolemize.html b/_modules/nltk/sem/skolemize.html
index bd41da61..76730746 100644
--- a/_modules/nltk/sem/skolemize.html
+++ b/_modules/nltk/sem/skolemize.html
@@ -271,7 +271,7 @@ Source code for nltk.sem.skolemize
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sem/util.html b/_modules/nltk/sem/util.html
index 3c8e80dd..72ac0a33 100644
--- a/_modules/nltk/sem/util.html
+++ b/_modules/nltk/sem/util.html
@@ -448,7 +448,7 @@ Source code for nltk.sem.util
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sentiment/sentiment_analyzer.html b/_modules/nltk/sentiment/sentiment_analyzer.html
index 86ea2b08..4b1d7884 100644
--- a/_modules/nltk/sentiment/sentiment_analyzer.html
+++ b/_modules/nltk/sentiment/sentiment_analyzer.html
@@ -408,7 +408,7 @@ Source code for nltk.sentiment.sentiment_analyzer
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sentiment/util.html b/_modules/nltk/sentiment/util.html
index fe99b4af..47859a5e 100644
--- a/_modules/nltk/sentiment/util.html
+++ b/_modules/nltk/sentiment/util.html
@@ -1049,7 +1049,7 @@ Source code for nltk.sentiment.util
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/sentiment/vader.html b/_modules/nltk/sentiment/vader.html
index 0c6d5495..deb737f4 100644
--- a/_modules/nltk/sentiment/vader.html
+++ b/_modules/nltk/sentiment/vader.html
@@ -792,7 +792,7 @@ Source code for nltk.sentiment.vader
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/api.html b/_modules/nltk/stem/api.html
index 16fd7160..a1ed9803 100644
--- a/_modules/nltk/stem/api.html
+++ b/_modules/nltk/stem/api.html
@@ -150,7 +150,7 @@ Source code for nltk.stem.api
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/arlstem.html b/_modules/nltk/stem/arlstem.html
index 4e5186f1..700e460c 100644
--- a/_modules/nltk/stem/arlstem.html
+++ b/_modules/nltk/stem/arlstem.html
@@ -523,7 +523,7 @@ Source code for nltk.stem.arlstem
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/arlstem2.html b/_modules/nltk/stem/arlstem2.html
index df20369e..bd85182b 100644
--- a/_modules/nltk/stem/arlstem2.html
+++ b/_modules/nltk/stem/arlstem2.html
@@ -625,7 +625,7 @@ Source code for nltk.stem.arlstem2
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/cistem.html b/_modules/nltk/stem/cistem.html
index 110191f8..1ca6097b 100644
--- a/_modules/nltk/stem/cistem.html
+++ b/_modules/nltk/stem/cistem.html
@@ -344,7 +344,7 @@ Source code for nltk.stem.cistem
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/isri.html b/_modules/nltk/stem/isri.html
index 9f2a4435..ef052131 100644
--- a/_modules/nltk/stem/isri.html
+++ b/_modules/nltk/stem/isri.html
@@ -560,7 +560,7 @@ Source code for nltk.stem.isri
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/lancaster.html b/_modules/nltk/stem/lancaster.html
index 9872e4a2..14a90ef0 100644
--- a/_modules/nltk/stem/lancaster.html
+++ b/_modules/nltk/stem/lancaster.html
@@ -471,7 +471,7 @@ Source code for nltk.stem.lancaster
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/porter.html b/_modules/nltk/stem/porter.html
index ff00d50e..498a7d09 100644
--- a/_modules/nltk/stem/porter.html
+++ b/_modules/nltk/stem/porter.html
@@ -846,7 +846,7 @@ Source code for nltk.stem.porter
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/regexp.html b/_modules/nltk/stem/regexp.html
index c8986b61..276d2f7a 100644
--- a/_modules/nltk/stem/regexp.html
+++ b/_modules/nltk/stem/regexp.html
@@ -181,7 +181,7 @@ Source code for nltk.stem.regexp
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/rslp.html b/_modules/nltk/stem/rslp.html
index 30667466..b49d5304 100644
--- a/_modules/nltk/stem/rslp.html
+++ b/_modules/nltk/stem/rslp.html
@@ -269,7 +269,7 @@ Source code for nltk.stem.rslp
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/snowball.html b/_modules/nltk/stem/snowball.html
index 39a20997..cb7eea96 100644
--- a/_modules/nltk/stem/snowball.html
+++ b/_modules/nltk/stem/snowball.html
@@ -6146,7 +6146,7 @@ Source code for nltk.stem.snowball
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/util.html b/_modules/nltk/stem/util.html
index fcba40d6..7b02d20c 100644
--- a/_modules/nltk/stem/util.html
+++ b/_modules/nltk/stem/util.html
@@ -148,7 +148,7 @@ Source code for nltk.stem.util
- Aug 16, 2024
+ Aug 18, 2024
diff --git a/_modules/nltk/stem/wordnet.html b/_modules/nltk/stem/wordnet.html
index fc68b21a..e4525fa3 100644
--- a/_modules/nltk/stem/wordnet.html
+++ b/_modules/nltk/stem/wordnet.html
@@ -102,6 +102,7 @@ Source code for nltk.stem.wordnet
# Copyright (C) 2001-2024 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# Edward Loper <edloper@gmail.com>
+# Eric Kafe <kafe.eric@gmail.com>
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
@@ -114,8 +115,47 @@ Source code for nltk.stem.wordnet