Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create words_alpha_clean.txt #108

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Create words_alpha_clean.txt #108

wants to merge 3 commits into from

Conversation

Orivoir
Copy link

@Orivoir Orivoir commented Oct 2, 2021

Add file words_alpha_clean.txt that a copy of words_alpha.txt but the words that not exists in english has been removed.
The sort has been effectuate with the API of wordsapi that allow the search of words in english, from a script i've call the API for each word,
and during not exists word i've remove word from a file.
You can find the doc API here.
The exact filter of a word is based on frequency data of API

if(!!response.word && typeof response.frequency == "object") {
					
    if(response.frequency.perMillion >= 15) {
         // here word is not removed
	realWords.push(response.word);
     }
     // else word is removed
}

The documentation indicate this below text for frequency data:

This is the number of times the word is likely to appear in any English corpus, per million words.

Add file `words_alpha_clean.txt` that a of `words_alpha.txt` but the words that not exists in english has been removed.
The sort has been effectuate with the `API` of [wordsapi](https://www.wordsapi.com/) that allow the search of words in english, from a script i've call the API for each word,
and during not exists word i've remove word from a file.
You can find the doc API [here](https://www.wordsapi.com/docs/).
The exact filter of a word is based on `frequency` data of API
```javascript
if(!!response.word && typeof response.frequency == "object") {
					
					if(response.frequency.perMillion >= 15) {
                                               // here word is not removed
						realWords.push(response.word);
					}
                                       // else word is removed
				}
``` 

The documentation indicate this below text for [frequency](https://www.wordsapi.com/docs/#frequency) data:

> This is the number of times the word is likely to appear in any English corpus, per million words.
@jcnmsg
Copy link

jcnmsg commented Nov 9, 2021

Nice work but from 350000+ lines only around 2500 survived? Seems like the parameters used have been a little too strict...

@Orivoir
Copy link
Author

Orivoir commented Nov 10, 2021

I used less strict filter with frequency data of same API for ~30 000 words results but i think again that some words not real english words. see 4971374

@jcnmsg
Copy link

jcnmsg commented Nov 11, 2021

~30 000 would be closer to reality but it appears to have duplicated a bunch of words as well which were not duplicated on the original words_alpha.txt. See bedrock. bedroll, bedroom, bedspread, bedstead as examples...

@Timokasse
Copy link

Nice work but from 350000+ lines only around 2500 survived? Seems like the parameters used have been a little too strict...

The API is free for 2500 words per day. That is probably why....

@jcnmsg
Copy link

jcnmsg commented Dec 24, 2021

The API is free for 2500 words per day. That is probably why....

@Orivoir did get ~30 000 words just by using different parameters, so that was probably not it.

@aploium
Copy link

aploium commented Dec 29, 2021

maybe it kills too much words. for example: blacklist is in it, but whitelist doesn't
sale not in, but sales is in

white lives matter, too [:joke:]

@ghost
Copy link

ghost commented Jan 8, 2022

Hi all, I have run the words_alpha.txt through the "nltk" python library. Total words are 210693. This seems to be a bit better, but I have noticed there are still a few oddities in there (maybe things like common abbreviations remain, which aren't actual words). But overall I think this has cleaned out any non-english words.

words_alpha_clean.txt

@silverwings15
Copy link

@SDidge appreciate the share!

@jcnmsg
Copy link

jcnmsg commented Jan 9, 2022

@SDidge At first glance I can't seem to find any non-english words on the file so I'd say this one is the cleanest file so far, nice work!

@Timokasse
Copy link

Hi all, I have run the words_alpha.txt through the "nltk" python library. Total words are 210693. This seems to be a bit better, but I have noticed there are still a few oddities in there (maybe things like common abbreviations remain, which aren't actual words). But overall I think this has cleaned out any non-english words.

words_alpha_clean.txt

@SDidge , what exactly did you use from the NLTK library to check the list of words?

@ghost
Copy link

ghost commented Jan 10, 2022

@Timokasse , I just checked if the word existed in the "words" corpus

E.g.

from nltk.corpus import words

word for words_alpha if word in words

Something like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants