-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added annotations for porter.py & preprocessing.py
- Loading branch information
Showing
2 changed files
with
51 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,21 @@ | |
Release 2: July 2008 | ||
Optimizations and cleanup of the code by Lars Buitinck, July 2012. | ||
-------------------------------------------------------------------- | ||
The main part of the stemming algorithm starts in :func:`~gensim.parsing.porter.PorterStemmer`. | ||
b is a buffer holding a word to be stemmed. The letters are in b[0], | ||
This comment has been minimized.
Sorry, something went wrong. |
||
b[1] ... ending at b[k]. k is readjusted downwards as the stemming | ||
progresses. j is word length. | ||
Example | ||
-------- | ||
>>> from gensim.parsing.porter import PorterStemmer | ||
>>> p = PorterStemmer() | ||
>>> print "b (word) = ", p.b, " ,k (readjusted downwards as the stemming progresses) = ", p.k, " ,j (word length) = ", p.j | ||
This comment has been minimized.
Sorry, something went wrong.
menshikh-iv
Contributor
|
||
b = ,k = 0 ,j = 0 | ||
""" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add link to wiki https://en.wikipedia.org/wiki/Stemming