diff options
author | Jesus Rivero <neurogeek@gentoo.org> | 2008-11-28 01:39:20 +0000 |
---|---|---|
committer | Jesus Rivero <neurogeek@gentoo.org> | 2008-11-28 01:39:20 +0000 |
commit | d5d3348b994abca61265ca038c6464bd97842ac7 (patch) | |
tree | f2883ecadbe60db55c1fc1931ff8c1879d081aea /dev-python/reverend | |
parent | version bump, changelog: https://projects.gentooexperimental.org/eix/browser/... (diff) | |
download | historical-d5d3348b994abca61265ca038c6464bd97842ac7.tar.gz historical-d5d3348b994abca61265ca038c6464bd97842ac7.tar.bz2 historical-d5d3348b994abca61265ca038c6464bd97842ac7.zip |
Initial commit. Thanks to David Guerizec for ebuild
Package-Manager: portage-2.2_rc12/cvs/Linux 2.6.18-gentoo-r3 i686
Diffstat (limited to 'dev-python/reverend')
-rw-r--r-- | dev-python/reverend/ChangeLog | 10 | ||||
-rw-r--r-- | dev-python/reverend/Manifest | 15 | ||||
-rw-r--r-- | dev-python/reverend/files/reverend-0.3-email.patch | 63 | ||||
-rw-r--r-- | dev-python/reverend/metadata.xml | 9 | ||||
-rw-r--r-- | dev-python/reverend/reverend-0.3.ebuild | 35 |
5 files changed, 132 insertions, 0 deletions
diff --git a/dev-python/reverend/ChangeLog b/dev-python/reverend/ChangeLog new file mode 100644 index 000000000000..5308eb8faef6 --- /dev/null +++ b/dev-python/reverend/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for dev-python/reverend +# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/reverend/ChangeLog,v 1.1 2008/11/28 01:39:20 neurogeek Exp $ + +*reverend-0.3 (28 Nov 2008) + + 28 Nov 2008; Jesus Rivero <neurogeek@gentoo.org> + +files/reverend-0.3-email.patch, +metadata.xml, +reverend-0.3.ebuild: + Initial commit. Thanks to David Guerizec for ebuild + diff --git a/dev-python/reverend/Manifest b/dev-python/reverend/Manifest new file mode 100644 index 000000000000..38d04d400a0f --- /dev/null +++ b/dev-python/reverend/Manifest @@ -0,0 +1,15 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +AUX reverend-0.3-email.patch 2025 RMD160 2681eadb8142fa705ba30f8b15f7ea48f7574388 SHA1 13e2555cc34fd601d15f4447c03255135df908ef SHA256 698c8e67802f7c184becc4103f186eb0db8f7763e4c77b767dd3ebdcbe5b748d +DIST Reverend-0.3.tar.gz 11892 RMD160 6a35e41fbbd6eeb910ca39f34ccc5b63cf250c83 SHA1 e981539e0e1f62280a93322d26d9b2f98c92c62e SHA256 a8610d05cf7be266fc3a6c779a4917aebd1f490649e365255e17c7fd9e799d17 +EBUILD reverend-0.3.ebuild 776 RMD160 43657323d194d75844bbd7f88c1911175889917a SHA1 0cdfe76da52bca359a63624ebf36b275b7d5df1e SHA256 b07a8cf94a27d648f2f5b52a81b00b057154c320d3417fdfb62fdeb01367d765 +MISC ChangeLog 421 RMD160 78128ad5767d357b0cae0628fd234c9b296c5737 SHA1 844837dd4ad1d246fa7ae77b485c769cd9852063 SHA256 cfa7aababd318c1a9544d5b67476fd2311a78142968a147b7d0186f7e4ec5ae6 +MISC metadata.xml 255 RMD160 b69d2df062aad1158c03b925d5bfdeab02f98db2 SHA1 c94d776662afd93f3be5dc1fea7793b80738dbc5 SHA256 01d09f8eee4532c21a12d462263dfa84fda9e1b421410b13fe9799ed4680ba7b +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.9 (GNU/Linux) + +iEYEARECAAYFAkkvS9IACgkQdIssYB9vBoM71ACaAy4NyKVFi+UaI1r+cvoXMseQ +1DQAn1/9DOiLt+I0x72ym0WxHlnBq1Vl +=sgrT +-----END PGP SIGNATURE----- diff --git a/dev-python/reverend/files/reverend-0.3-email.patch b/dev-python/reverend/files/reverend-0.3-email.patch new file mode 100644 index 000000000000..6b343d61b7a0 --- /dev/null +++ b/dev-python/reverend/files/reverend-0.3-email.patch @@ -0,0 +1,63 @@ +--- reverend/guessers/email.py 2006-04-25 00:15:27.000000000 +0200 ++++ reverend/guessers/email.py 2006-04-25 01:12:16.000000000 +0200 +@@ -9,7 +9,6 @@ + import email + + from reverend.thomas import Bayes +-from reverend.splitter import Splitter + + + class EmailClassifier(Bayes): +@@ -19,19 +18,22 @@ + # This should return a list of strings + # which will be used as the key into + # the table of token counts +- tokens = self.getHeaderTokens(msg) +- tokens += self.getBodyTokens(msg) +- ++ for tok in self.getHeaderTokens(msg): ++ yield tok ++ ++ for tok in self.getBodyTokens(msg): ++ yield tok ++ + # Get some tokens that are generated from the + # header and the structure +- tokens += self.getMetaTokens(msg) +- return tokens ++ for tok in self.getMetaTokens(msg): ++ yield tok + + def getBodyTokens(self, msg): + text = self.getTextPlain(msg) + if text is None: + text = '' +- tl = self.splitter.split(text) ++ tl = self._tokenizer.tokenize(text) + return tl + + def getHeaderTokens(self, msg): +@@ -40,12 +42,12 @@ + text += msg.get('from','fromnoone') + ' ' + text += msg.get('to','tonoone') + ' ' + text += msg.get('cc','ccnoone') + ' ' +- tl = self.splitter.split(text) ++ tl = self._tokenizer.tokenize(text) + return tl + + def getTextPlain(self, msg): + for part in msg.walk(): +- typ = part.get_type() ++ typ = part.get_content_type() + if typ and typ.lower() == "text/plain": + text = part.get_payload(decode=True) + return text +@@ -53,7 +55,7 @@ + + def getTextHtml(self, msg): + for part in msg.walk(): +- typ = part.get_type() ++ typ = part.get_content_type() + if typ and typ.lower() == "text/html": + text = part.get_payload(decode=False) + return text diff --git a/dev-python/reverend/metadata.xml b/dev-python/reverend/metadata.xml new file mode 100644 index 000000000000..2ea988a46e81 --- /dev/null +++ b/dev-python/reverend/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>python</herd> + <maintainer> + <email>neurogeek@gentoo.org</email> + <name>Jesus Rivero</name> + </maintainer> +</pkgmetadata> diff --git a/dev-python/reverend/reverend-0.3.ebuild b/dev-python/reverend/reverend-0.3.ebuild new file mode 100644 index 000000000000..a5abd753a492 --- /dev/null +++ b/dev-python/reverend/reverend-0.3.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/reverend/reverend-0.3.ebuild,v 1.1 2008/11/28 01:39:20 neurogeek Exp $ + +inherit distutils + +MY_P=R${P#r} + +DESCRIPTION="Reverend - Simple Bayesian classifier" +SRC_URI="mirror://sourceforge/reverend/${MY_P}.tar.gz" +HOMEPAGE="http://divmod.org/trac/wiki/DivmodReverend" +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="examples" + +DEPEND="virtual/python" + +DOCS="README.txt changelog.txt" +S="${WORKDIR}/${MY_P}" + +src_unpack() { + distutils_src_unpack + epatch "${FILESDIR}/${P}-email.patch" +} + + +src_install() { + distutils_src_install + + if use examples; then + insinto /usr/share/doc/${PF}/examples + doins examples/* + fi +} |