Skip to content

Commit 3433c53

Browse files
authored
Remove WordFrequencyData ... (#13)
for now. __init__.py "library" -> Python library
1 parent 12a33ab commit 3433c53

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

pymathics/natlang/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Natural Language Processing
33
44
Mathics3 Module module provides functions and variables to work with \
5-
expressions in natural language, using the libraries:
5+
expressions in natural language, using the Python libraries:
66
77
<ul>
88
<li><url>:spacy:
@@ -56,7 +56,6 @@
5656
WordData,
5757
WordDefinition,
5858
WordFrequency,
59-
WordFrequencyData,
6059
WordList,
6160
WordSimilarity,
6261
WordStem,
@@ -87,7 +86,6 @@
8786
"WordData",
8887
"WordDefinition",
8988
"WordFrequency",
90-
"WordFrequencyData",
9189
"WordList",
9290
"WordSimilarity",
9391
"WordStem",

pymathics/natlang/main.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -265,27 +265,6 @@ def is_stop(word):
265265
return is_stop
266266

267267

268-
class WordFrequencyData(_SpacyBuiltin):
269-
"""
270-
<dl>
271-
<dt>'WordFrequencyData[$word$]'
272-
<dd>returns the frequency of $word$ in common English texts.
273-
</dl>
274-
"""
275-
276-
# Mathematica uses the gargantuan Google n-gram corpus, see
277-
# http://commondatastorage.googleapis.com/books/syntactic-ngrams/index.html
278-
279-
def eval(self, word: String, evaluation: Evaluation, options: dict) -> Real:
280-
"WordFrequencyData[word_String, OptionsPattern[WordFrequencyData]]"
281-
doc = self._nlp(word.value, evaluation, options)
282-
frequency = 0.0
283-
if doc:
284-
if len(doc) == 1:
285-
frequency = math.exp(doc[0].prob) # convert log probability
286-
return Real(frequency)
287-
288-
289268
class WordCount(_SpacyBuiltin):
290269
"""
291270
<dl>

0 commit comments

Comments
 (0)