From 8b1f87b1c027672b46871a623c57f43110e9ed39 Mon Sep 17 00:00:00 2001 From: Scott MacVicar Date: Wed, 6 May 2015 14:16:11 -0700 Subject: [PATCH] Get this building and passing tests Changes: * add .DS_Store to .gitignore * Decode base64 encoded emails for tests * Pick a version of scikit since the pickled clasifiers are based on that * Add missing numpy and scipy dependencies --- .gitignore | 5 ++++- setup.py | 4 +++- talon/signature/data/classifier | Bin 632 -> 608 bytes talon/signature/data/classifier_01.npy | Bin 88 -> 96 bytes talon/signature/data/classifier_02.npy | Bin 96 -> 176 bytes talon/signature/data/classifier_03.npy | Bin 184 -> 88 bytes tests/text_quotations_test.py | 2 +- 7 files changed, 8 insertions(+), 3 deletions(-) mode change 100644 => 100755 setup.py diff --git a/.gitignore b/.gitignore index af985ab..002f03e 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,7 @@ tramp *_archive # Trial temp -_trial_temp \ No newline at end of file +_trial_temp + +# OSX +.DS_Store \ No newline at end of file diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 8bd9591..fa94f58 --- a/setup.py +++ b/setup.py @@ -18,8 +18,10 @@ setup(name='talon', "regex>=1", "html2text", "nose>=1.2.1", + "numpy", "mock", "coverage", - "scikit-learn", + "scipy", + "scikit-learn==0.16.1", # pickled versions of classifier, else rebuild ] ) diff --git a/talon/signature/data/classifier b/talon/signature/data/classifier index 405e6cd13dec1aa226d471dfca371bc52b8949d5..b7d72eb989596b74547efcbbcfbe280cc79f855d 100644 GIT binary patch delta 386 zcmX|+%}WAN6vbzp5oJ=$$}F|AveZ6Yh_ng{TnG)#Lb&V4bA0N+eBGHh)htBXl*^=l zFj@)y1MO;>z_Yk;Ilp@k=Ue`e-#YcIj{)`AkW37F%uoigi^<+?O^5|)-K4(H{6&8; z%NsUlp3YoOe4UyRk2zHYc^FU=*XNKO8Jw&b%+Dch(I;X=N4Rmnlptlt3&Bm@4lFlp z>5j)*R$y|2dL9jxzqiy=aO>Y!hCFncf(1wz9h_~ef-1gZv5z|qRRZxEcQsAB`-v0} zRp3|}fV`9h0n0B~>Ej-xTxL^~hqw<3vyBI^7Uz+;7gj-X9y~mRj7ROEV-cTI&hSVB zi9049_ijp8pI?>kB_#En!$t&alT`B=Po{YKJ`)SocFT4{tOo;7R?P`EVyHRAvj{2| U&m%h%2a-o-j3*o~v|!Ns1sX$zi2wiq delta 403 zcmZvYJx>Bb5QYVgs0T*zTR{9m1&tSD&{h*-C{((wEH-<~!d+bUZg%%16c=M>Dd7(q zTmOJ|o@+uZoMMW3GtWGkH|x`SZB)|y3@nstLbi2Poic@NUuY&N3-#!J)UY}c;V}P# z=DNPdlL!`)3FSm7JYas$(-;cgbp06?V^|u0rAl|pk&C87CJ5IqlJs*et;+ z$^?%R)=*v&(FyukX`&gdx6!O5155+f#js(B#TZIsCtZ3fCqxS~L1B}s2hNBTPAFL@ z1Im>0MbF{HW!%2~>DPh=9VTt4BvM;3Y@-=-nJElAhPxZXUd^+;oR>!hllfhrNqpLH zL^yW4#~!647Gm|=LS(vg!6x&1V?RDnEVhcN_e6T K$2Y0Sb-n=t*N8g+ diff --git a/talon/signature/data/classifier_01.npy b/talon/signature/data/classifier_01.npy index 29344244b01bdd6d427cfe78e1083bad25c74ff7..11d130269642d0ec81c199f8cb370f603d1e5da9 100644 GIT binary patch delta 40 dcmaz@m|&}Hq@$^$P^*9hxER3T!+t1j4*;LS2VnpJ delta 32 ecmYd@m|!bysH3T)P^*9hxOUEaE>a==YCiydEeQw! diff --git a/talon/signature/data/classifier_02.npy b/talon/signature/data/classifier_02.npy index 7c6997dd69eef019d6745dee125e92434b7954e3..0f965baa69b0df1b8f38acd7fa1e76f2c1a0a897 100644 GIT binary patch delta 139 zcmYe;z&JstKBTBLRYyU+I3uwjRozNK!%#=T&`489p;iG7xD2*3RF)rkYyU^w;J$6B|6?}aS@psG!J=o+r&av0Kj6H=S6$?d{f^D0?*m$X i+V}jb@KI^rZ(ruH=zF-w_Wdxr@yTJ<4{kLu= diff --git a/talon/signature/data/classifier_03.npy b/talon/signature/data/classifier_03.npy index 97d9aa3ec06e932df59bcf4aa1d56cc0ad039210..5a35962eb9617631417f9bf564c051e71818867b 100644 GIT binary patch delta 50 wcmdnN7%@Rd$1O3ZI8{eMy*MMWAXVK;LBmi-Q%9jz0SR!GNzbm2lYX@y0AL6WxBvhE delta 147 zcma#p!8k#uKBTBLRYyU+I3uwjRozNK!%#=T&{$JPp;iG7xIP$$-_tqy);_$U)cwpM zh6CG|srBpK{bj$dUn0fe+7tWTGgMrTtomR-VRN__U*!+`6tgWq_KUo+e{^F*E@#V6 p`w!BQB^6Ek?Ui(mjOV*=-w&f_@N4mEo4)*RzjNMmkqYTo`vEfdJ$wKF diff --git a/tests/text_quotations_test.py b/tests/text_quotations_test.py index 0a87e56..fcf5fcd 100644 --- a/tests/text_quotations_test.py +++ b/tests/text_quotations_test.py @@ -618,7 +618,7 @@ def test_standard_replies(): with open(filename) as f: message = email.message_from_file(f) body = email.iterators.typed_subpart_iterator(message, subtype='plain').next() - text = ''.join(email.iterators.body_line_iterator(body)) + text = ''.join(email.iterators.body_line_iterator(body, True)) stripped_text = quotations.extract_from_plain(text) reply_text_fn = filename[:-4] + '_reply_text'