Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: heatherleaf/nltk
base: 57e91876c2
...
head fork: heatherleaf/nltk
compare: fbe7f3dccb
  • 5 commits
  • 3 files changed
  • 0 commit comments
  • 3 contributors
Showing with 19 additions and 4 deletions.
  1. +13 −0 .gitignore
  2. +3 −3 nltk/corpus/reader/wordnet.py
  3. +3 −1 nltk/internals.py
View
13 .gitignore
@@ -2,3 +2,16 @@
*.pyo
.tox
+*.class
+*.jar
+
+*.egg
+build/
+dist/
+nltk.egg-info/
+
+# generated by tests
+*.errs
+
+# editor temporary files
+*.*.sw[op]
View
6 nltk/corpus/reader/wordnet.py
@@ -729,7 +729,7 @@ def res_similarity(self, other, ic, verbose=False):
:type other: Synset
:param other: The ``Synset`` that this ``Synset`` is being compared to.
:type ic: dict
- :param ic: an information content object (as returned by ``load_ic()``).
+ :param ic: an information content object (as returned by ``nltk.corpus.wordnet_ic.ic()``).
:return: A float score denoting the similarity of the two ``Synset`` objects.
Synsets whose LCS is the root node of the taxonomy will have a
score of 0 (e.g. N['dog'][0] and N['table'][0]).
@@ -749,7 +749,7 @@ def jcn_similarity(self, other, ic, verbose=False):
:type other: Synset
:param other: The ``Synset`` that this ``Synset`` is being compared to.
:type ic: dict
- :param ic: an information content object (as returned by ``load_ic()``).
+ :param ic: an information content object (as returned by ``nltk.corpus.wordnet_ic.ic()``).
:return: A float score denoting the similarity of the two ``Synset`` objects.
"""
@@ -781,7 +781,7 @@ def lin_similarity(self, other, ic, verbose=False):
:type other: Synset
:param other: The ``Synset`` that this ``Synset`` is being compared to.
:type ic: dict
- :param ic: an information content object (as returned by ``load_ic()``).
+ :param ic: an information content object (as returned by ``nltk.corpus.wordnet_ic.ic()``).
:return: A float score denoting the similarity of the two ``Synset`` objects,
in the range 0 to 1.
"""
View
4 nltk/internals.py
@@ -17,7 +17,9 @@
import sys
import stat
-from xml.etree import cElementTree as ElementTree
+# Use the c version of ElementTree, which is faster, if possible:
+try: from xml.etree import cElementTree as ElementTree
+except ImportError: from xml.etree import ElementTree
from nltk import __file__

No commit comments for this range

Something went wrong with that request. Please try again.