Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update python runtime, make file, setup.py script
- Loading branch information
Yoshiki Shibukawa
committed
Feb 14, 2013
1 parent
20d329f
commit 8863276
Showing
9 changed files
with
611 additions
and
24 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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
License | ||
------- | ||
|
||
Copyright (c) 2013, Yoshiki Shibukawa | ||
|
||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided | ||
that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this list of conditions and | ||
the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions | ||
and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR | ||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS | ||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
Snowball stemming library collection for Python | ||
=============================================== | ||
|
||
This document pertains to the Python version of the stemmer library distribution, | ||
available for download from: | ||
|
||
* https://github.com/shibukawa/snowball_jsx/ | ||
|
||
Original program is maintained at following place: | ||
|
||
* http://snowball.tartarus.org/ | ||
|
||
Original Snowball product is created by Dr Martin Porter and Richard Boulton (Java porting) under | ||
BSD license. | ||
|
||
How to use library | ||
------------------ | ||
|
||
You can use each stemming modules from Python program. | ||
|
||
.. code-block:: python | ||
import snowballstemmer | ||
stemmer = snowballstemmer.EnglishStemmer(); | ||
print(stemmer.stem("We are the world")); | ||
Following modules are common modules. Don't forget bundle these modules to your program: | ||
|
||
* ``snowballstemmer/__init__.py`` | ||
* ``snowballstemmer/among.py`` | ||
* ``snowballstemmer/basestemmer.jsx`` | ||
|
||
Following modules are optiona modules. Select your needed language modules: | ||
|
||
* ``danish_stemmer.py`` | ||
* ``dutch_stemmer.py`` | ||
* ``english_stemmer.py`` | ||
* ``finnish_stemmer.py`` | ||
* ``french_stemmer.py`` | ||
* ``german_stemmer.py`` | ||
* ``hungarian_stemmer.py`` | ||
* ``italian_stemmer.py`` | ||
* ``norwegian_stemmer.py`` | ||
* ``porter_stemmer.py`` | ||
* ``portuguese_stemmer.py`` | ||
* ``romanian_stemmer.py`` | ||
* ``russian_stemmer.py`` | ||
* ``spanish_stemmer.py`` | ||
* ``swedish_stemmer.py`` | ||
* ``turkish_stemmer.py`` | ||
|
||
The TestApp example | ||
------------------- | ||
|
||
The :file:`testapp.jsx` example program allows you to run any of the stemmers | ||
on a sample vocabulary. | ||
|
||
Usage:: | ||
|
||
testapp.py <algorithm> "sentences ... " | ||
|
||
.. code-block:: bash | ||
$ python testapp.py English "sentences... " | ||
License | ||
------- | ||
|
||
It is a BSD licensed library. | ||
|
||
----------------------------- | ||
|
||
Copyright (c) 2013, Yoshiki Shibukawa | ||
|
||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided | ||
that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this list of conditions and | ||
the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions | ||
and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR | ||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS | ||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include *.rst | ||
include setup.* | ||
recursive-include src *.py | ||
include MANIFEST.in |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env python | ||
|
||
from distutils.core import setup | ||
|
||
setup(name='snowballstemmer', | ||
version='0.1.0', | ||
description='This package provides 16 stemmer algorithms (15 + Poerter English stemmer) generated from Snowball algorithms.', | ||
long_description=''' | ||
It includes following language algorithms: | ||
* Danish | ||
* Dutch | ||
* English (Standard, Porter) | ||
* Finnish | ||
* French | ||
* German | ||
* Hungarian | ||
* Italian | ||
* Norwegian | ||
* Portuguese | ||
* Romanian | ||
* Russian | ||
* Spanish | ||
* Swedish | ||
* Turkish | ||
''', | ||
author='Yoshiki Shibukawa', | ||
author_email='yoshiki at shibu.jp', | ||
url='https://github.com/shibukawa/snowball_py', | ||
keywords="stemmer", | ||
license="BSD", | ||
package_dir={"snowballstemmer": "src/snowballstemmer"}, | ||
classifiers = [ | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Programming Language :: Python', | ||
'Natural Language :: Danish', | ||
'Natural Language :: Dutch', | ||
'Natural Language :: English', | ||
'Natural Language :: Finnish', | ||
'Natural Language :: French', | ||
'Natural Language :: German', | ||
'Natural Language :: Hungarian', | ||
'Natural Language :: Italian', | ||
'Natural Language :: Norwegian', | ||
'Natural Language :: Portuguese', | ||
'Natural Language :: Romanian', | ||
'Natural Language :: Russian', | ||
'Natural Language :: Spanish', | ||
'Natural Language :: Swedish', | ||
'Natural Language :: Turkish', | ||
'Operating System :: OS Independent' | ||
] | ||
) |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
class Among(object): | ||
def __init__(self, s, substring_i, result, method=None): | ||
""" | ||
@ivar s_size search string size | ||
@ivar s search string | ||
@ivar substring index to longest matching substring | ||
@ivar result of the lookup | ||
@ivar method method to use if substring matches | ||
""" | ||
self.s_size = len(s) | ||
self.s = s | ||
self.substring_i = substring_i | ||
self.result = result | ||
self.method = method |
Oops, something went wrong.