Skip to content
Browse files

Merge pull request #6 from avoinea/master

Make it work with Plone 4.1-latest
  • Loading branch information...
2 parents 08bca29 + 8aa251a commit 94923e25822b2f702885ae718bdb3f09a00794ff Yiorgis Gozadinos committed
View
6 cfgs/plone-4.cfg
@@ -1,11 +1,11 @@
[buildout]
extends =
- http://dist.plone.org/release/4.0b5/versions.cfg
+ http://dist.plone.org/release/4.1-latest/versions.cfg
extensions = mr.developer buildout.dumppickedversions
find-links =
- http://dist.plone.org/release/4.0b5
+ http://dist.plone.org/release/4.1-latest
http://dist.plone.org/thirdparty/
http://download.zope.org/ppix/
http://download.zope.org/distribution/
@@ -71,4 +71,4 @@ initialization =
bin = '${buildout:directory}/bin'
tests = '${buildout:directory}/src/collective/classification/tests'
exclude = '--omit=' + ','.join([eggs, sys.prefix, bin, tests])
- sys.argv = sys.argv[:] + ['xml', '-i', exclude]
+ sys.argv = sys.argv[:] + ['xml', '-i', exclude]
View
6 src/collective/classification/browser/classificationstats.py
@@ -2,12 +2,14 @@
from zope.component import getUtility
from zope import schema
from zope.formlib import form
-from Products.Five.formlib import formbase
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.CMFCore.utils import getToolByName
from collective.classification.interfaces import IContentClassifier
from collective.classification import ClassificationMessageFactory as _
-
+try:
+ from five.formlib import formbase
+except ImportError:
+ from Products.Five.formlib import formbase
class IStats(Interface):
no_features = schema.Int(
View
6 src/collective/classification/browser/clusterize.py
@@ -2,11 +2,13 @@
from zope.formlib import form
from zope import schema
from zope.interface import Interface
-from Products.Five.formlib import formbase
from Products.CMFCore.utils import getToolByName
from collective.classification import ClassificationMessageFactory as _
from collective.classification.classifiers.clustering import KMeans
-
+try:
+ from five.formlib import formbase
+except ImportError:
+ from Products.Five.formlib import formbase
class IClusterize(Interface):
View
6 src/collective/classification/browser/suggestcategories.py
@@ -5,12 +5,14 @@
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
from zope.formlib import form
from plone.app.form.interfaces import IPlonePageForm
-from Products.Five.formlib import formbase
from Products.statusmessages.interfaces import IStatusMessage
from collective.classification.interfaces import IContentClassifier, \
IClassifiable
from collective.classification import ClassificationMessageFactory as _
-
+try:
+ from five.formlib import formbase
+except ImportError:
+ from Products.Five.formlib import formbase
class ISuggestCategories(Interface):
"""
View
6 src/collective/classification/data/downloader.py
@@ -30,3 +30,9 @@ def downloadNLTKAlpinoCorpus():
logger = logging.getLogger('collective.classification')
logger.info("Downloading NLTK's Alpino corpus")
download('alpino')
+
+def downloadNLTKEurParlRaw():
+ logger = logging.getLogger('collective.classification')
+ logger.info("Downloading NLTK's Sample European Parliament Proceedings "
+ "Parallel Corpus")
+ download('europarl_raw')
View
10 src/collective/classification/data/trainers.py
@@ -30,3 +30,13 @@ def dutch():
tagger = BrillTrigramTagger()
tagger.train(alpino_sents)
dump(tagger.tagger, "dutch_tagger.pickle")
+
+def romanian():
+ from collective.classification.data.downloader import\
+ downloadNLTKEurParlRaw
+ downloadNLTKEurParlRaw()
+ from nltk.corpus import europarl_raw
+ europarl_sents = europarl_raw.romanian.sents()
+ tagger = BrillTrigramTagger()
+ tagger.train(europarl_sents)
+ dump(tagger.tagger, "romanian_tagger.pickle")

0 comments on commit 94923e2

Please sign in to comment.
Something went wrong with that request. Please try again.