Commit Graph

488 Commits

Author SHA1 Message Date
Andrew Lin
54eece5e8c Clarify the algorithm for range calculation using an explicit variable.
Former-commit-id: 6755741e7d
2015-07-09 16:47:33 -04:00
Andrew Lin
8a3638bc59 Whoops -- put back 'file' as a variable name. (The perils of trusting syntax highlighting...)
Former-commit-id: f591e74663
2015-07-09 16:18:56 -04:00
Andrew Lin
4acf8e0667 Remove an unused temporary.
Former-commit-id: 47ee662e24
2015-07-09 15:50:44 -04:00
Andrew Lin
5c72e68b7e Express the combining of word frequencies in an explicitly associative and commutative way.
Former-commit-id: 32b4033d63
2015-07-09 15:29:05 -04:00
Andrew Lin
ce364297a2 Switch to a faster 'drop everything' style cache for word_frequency().
Former-commit-id: 2821f23e79
2015-07-09 14:32:16 -04:00
Andrew Lin
d92a2fbd47 Close a file a little earlier.
Former-commit-id: b4bae84aac
2015-07-09 14:03:24 -04:00
Andrew Lin
921ea7ed05 Spacing tweaks.
Former-commit-id: 677ed6eb87
2015-07-09 13:26:49 -04:00
Andrew Lin
383963f8a9 Document the version of Unicode used to build the regexes.
Former-commit-id: 9f8464c2d1
2015-07-08 18:48:33 -04:00
Andrew Lin
05e14592af Tweaks to the regex generator for brevity:
* Don't repeat the logic that generates the ranges
  * Include only unassigned characters between two accepted ranges; this causes the resulting
    regexes to be a bit more readable.
  * Rearrange the script itself to avoid long lambdas and group helper functions together
  * Precompute the list of all the character classes for speed and terseness


Former-commit-id: cc6920d7e4
2015-07-08 15:29:31 -04:00
Andrew Lin
eab2c6d881 Merge pull request #6 from LuminosoInsight/code-review-leftovers
Code review leftovers
2015-07-07 19:39:44 -04:00
Robyn Speer
e9d88bf35e add docstrings and remove some brackets 2015-07-07 18:22:51 -04:00
Robyn Speer
91edae8307 fix duplication
Former-commit-id: d4d7b2f72e
2015-07-07 18:18:27 -04:00
Robyn Speer
2d32bc5579 mention Google Books Ngrams in the word_frequency docstring
Former-commit-id: d9a5b452fd
2015-07-07 18:07:39 -04:00
Andrew Lin
ad165d2830 Merge pull request #15 from LuminosoInsight/wordfreq-review
General style fixes and improvements from the code review

Former-commit-id: 8686a47a30
2015-07-07 16:53:17 -04:00
Joshua Chin
d4409a2214 removed unused imports
Former-commit-id: b9578ae21e
2015-07-07 16:21:22 -04:00
Joshua Chin
a7c380153f added documentation to load ranges
Former-commit-id: af362480d5
2015-07-07 16:00:37 -04:00
Joshua Chin
7e9338f87e cleaned up gen regex
Former-commit-id: 27ea107e6f
2015-07-07 16:00:24 -04:00
Joshua Chin
a72b4abb48 revert to using global mecab_tokenize variable
Former-commit-id: 189a5b9cd6
2015-07-07 15:47:37 -04:00
Joshua Chin
4b398fac65 updated minimum
Former-commit-id: 59c03e2411
2015-07-07 15:46:33 -04:00
Joshua Chin
4389422958 updated emoji parser
Former-commit-id: f04ca8fc9e
2015-07-07 15:43:34 -04:00
Joshua Chin
94ba6e650f updated docstring
Former-commit-id: 9b851f3afe
2015-07-07 15:33:51 -04:00
Joshua Chin
16a785a5e4 factored out range loading
Former-commit-id: 32803b235b
2015-07-07 15:33:36 -04:00
Joshua Chin
a87d84b796 fixed spacing
Former-commit-id: ae4699029d
2015-07-07 15:23:15 -04:00
Joshua Chin
cb4e444723 fixed gen_regex
Former-commit-id: 5510fce675
2015-07-07 15:22:04 -04:00
Joshua Chin
b3a008f992 added arabic tests
Former-commit-id: f83d31a357
2015-07-07 15:10:59 -04:00
Joshua Chin
21c809416d changed default to minimum for word_frequency
Former-commit-id: 9aa773aa2b
2015-07-07 15:03:26 -04:00
Joshua Chin
7279ab1e80 added docstring to top_n_list
Former-commit-id: 0b25caaf24
2015-07-07 15:01:39 -04:00
Joshua Chin
a408e6f96a fix grammar
Former-commit-id: bd172594d3
2015-07-07 14:59:28 -04:00
Joshua Chin
02526f658c updated _emoji_char_class docstring
Former-commit-id: 10b5727725
2015-07-07 14:58:50 -04:00
Joshua Chin
3e7f812e0c removed intermediate lists
Former-commit-id: 5342ea3033
2015-07-07 14:57:45 -04:00
Joshua Chin
25336c45b4 updated number of words to 5
Former-commit-id: 4b49b1a547
2015-07-07 14:56:40 -04:00
Joshua Chin
e1435136e3 updated word_frequency docstring
Former-commit-id: 4304a400f7
2015-07-07 14:56:12 -04:00
Joshua Chin
a9a48229e0 run cB_to_freq only once per bucket
Former-commit-id: 5e8ef19321
2015-07-07 14:55:13 -04:00
Joshua Chin
8ab615dde9 use itertools.chain
Former-commit-id: 6a40e63060
2015-07-07 14:54:19 -04:00
Joshua Chin
0308246e72 fixed Error string
Former-commit-id: bbdc064528
2015-07-07 14:51:46 -04:00
Joshua Chin
d875aa8842 updated gen_regex to be run as script
Former-commit-id: 22fbea4248
2015-07-07 14:50:56 -04:00
Joshua Chin
d4685759e3 removed unused imports
Former-commit-id: f3f9a654ea
2015-07-07 14:48:11 -04:00
Joshua Chin
3d221f0605 updated imports
Former-commit-id: f2b615b0f0
2015-07-07 14:46:42 -04:00
Joshua Chin
c5135edd88 imports are already cached
Former-commit-id: b1cd2e01d3
2015-07-07 14:44:50 -04:00
Joshua Chin
93681e43b3 factored out regex generation
Former-commit-id: 476a909e4d
2015-07-07 14:38:21 -04:00
Joshua Chin
9a513a2224 factored out emoji regex
Former-commit-id: 781a072713
2015-07-07 14:37:31 -04:00
Joshua Chin
9c741bb341 updated tests
Former-commit-id: ca66a5f883
2015-07-07 14:13:28 -04:00
Joshua Chin
1c365e6a50 Removes mention of Rosette from README 2015-07-07 10:32:16 -04:00
Robyn Speer
090cfa7088 declare 'mecab' as an extra
Former-commit-id: a69ea5ad52
2015-07-02 17:11:51 -04:00
Robyn Speer
83939020d0 declare that tests require mecab-python3
Former-commit-id: 7b4ebd1805
2015-07-02 11:29:11 -04:00
Joshua Chin
427d5e7fc7 Merge pull request #5 from LuminosoInsight/add-twitter-build
add 'twitter' as a final build, and a new build dir
2015-07-01 18:01:32 -04:00
Joshua Chin
98788628e9 Merge pull request #14 from LuminosoInsight/add-twitter-wordlists
Add twitter wordlists

Former-commit-id: 2acca8a27a
2015-07-01 18:00:30 -04:00
Robyn Speer
9615b9f843 test and document new twitter wordlists
Former-commit-id: 14cb408100
2015-07-01 17:53:38 -04:00
Robyn Speer
215eafc50b add Twitter-specific wordlists
Former-commit-id: 7e3066d3fc
2015-07-01 17:49:33 -04:00
Robyn Speer
3eb3e7c388 add 'twitter' as a final build, and a new build dir
The `data/dist` directory is now a convenient place to find the final
built files that can be copied into wordfreq.
2015-07-01 17:45:39 -04:00