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

Load stopwords from a file #29

Open
ibnesayeed opened this issue Feb 18, 2022 · 1 comment
Open

Load stopwords from a file #29

ibnesayeed opened this issue Feb 18, 2022 · 1 comment

Comments

@ibnesayeed
Copy link
Member

Supplying a long list of stopwords as an inline CLI argument can be tricky or even impossible. having an option to load it from a file would be great.

@ibnesayeed
Copy link
Member Author

It looks like the default list of stopwords is hard-coded in a Python file. Perhaps it will be more flexible to extract it out as a text file and iterate over it during the loading process. This way, a custom list of stopwords can be provided the same way as the default one.

sumgram/sumgram/util.py

Lines 35 to 326 in 31434ea

stopwordsDict = {
"a": True,
"about": True,
"above": True,
"across": True,
"after": True,
"afterwards": True,
"again": True,
"against": True,
"all": True,
"almost": True,
"alone": True,
"along": True,
"already": True,
"also": True,
"although": True,
"always": True,
"am": True,
"among": True,
"amongst": True,
"amoungst": True,
"amount": True,
"an": True,
"and": True,
"another": True,
"any": True,
"anyhow": True,
"anyone": True,
"anything": True,
"anyway": True,
"anywhere": True,
"are": True,
"around": True,
"as": True,
"at": True,
"back": True,
"be": True,
"became": True,
"because": True,
"become": True,
"becomes": True,
"becoming": True,
"been": True,
"before": True,
"beforehand": True,
"behind": True,
"being": True,
"below": True,
"beside": True,
"besides": True,
"between": True,
"beyond": True,
"both": True,
"but": True,
"by": True,
"can": True,
"can\'t": True,
"cannot": True,
"cant": True,
"co": True,
"could not": True,
"could": True,
"couldn\'t": True,
"couldnt": True,
"de": True,
"describe": True,
"detail": True,
"did": True,
"do": True,
"does": True,
"doing": True,
"done": True,
"due": True,
"during": True,
"e.g": True,
"e.g.": True,
"e.g.,": True,
"each": True,
"eg": True,
"either": True,
"else": True,
"elsewhere": True,
"enough": True,
"etc": True,
"etc.": True,
"even though": True,
"ever": True,
"every": True,
"everyone": True,
"everything": True,
"everywhere": True,
"except": True,
"for": True,
"former": True,
"formerly": True,
"from": True,
"further": True,
"get": True,
"go": True,
"had": True,
"has not": True,
"has": True,
"hasn\'t": True,
"hasnt": True,
"have": True,
"having": True,
"he": True,
"hence": True,
"her": True,
"here": True,
"hereafter": True,
"hereby": True,
"herein": True,
"hereupon": True,
"hers": True,
"herself": True,
"him": True,
"himself": True,
"his": True,
"how": True,
"however": True,
"i": True,
"ie": True,
"i.e": True,
"i.e.": True,
"if": True,
"in": True,
"inc": True,
"inc.": True,
"indeed": True,
"into": True,
"is": True,
"it": True,
"its": True,
"it's": True,
"itself": True,
"just": True,
"keep": True,
"latter": True,
"latterly": True,
"less": True,
"made": True,
"make": True,
"may": True,
"me": True,
"meanwhile": True,
"might": True,
"mine": True,
"more": True,
"moreover": True,
"most": True,
"mostly": True,
"move": True,
"must": True,
"my": True,
"myself": True,
"namely": True,
"neither": True,
"never": True,
"nevertheless": True,
"next": True,
"no": True,
"nobody": True,
"none": True,
"noone": True,
"nor": True,
"not": True,
"nothing": True,
"now": True,
"nowhere": True,
"of": True,
"off": True,
"often": True,
"on": True,
"once": True,
"one": True,
"only": True,
"onto": True,
"or": True,
"other": True,
"others": True,
"otherwise": True,
"our": True,
"ours": True,
"ourselves": True,
"out": True,
"over": True,
"own": True,
"part": True,
"per": True,
"perhaps": True,
"please": True,
"put": True,
"rather": True,
"re": True,
"same": True,
"see": True,
"seem": True,
"seemed": True,
"seeming": True,
"seems": True,
"several": True,
"she": True,
"should": True,
"show": True,
"side": True,
"since": True,
"sincere": True,
"so": True,
"some": True,
"somehow": True,
"someone": True,
"something": True,
"sometime": True,
"sometimes": True,
"somewhere": True,
"still": True,
"such": True,
"take": True,
"than": True,
"that": True,
"the": True,
"their": True,
"theirs": True,
"them": True,
"themselves": True,
"then": True,
"thence": True,
"there": True,
"thereafter": True,
"thereby": True,
"therefore": True,
"therein": True,
"thereupon": True,
"these": True,
"they": True,
"this": True,
"those": True,
"though": True,
"through": True,
"throughout": True,
"thru": True,
"thus": True,
"to": True,
"together": True,
"too": True,
"toward": True,
"towards": True,
"un": True,
"until": True,
"upon": True,
"us": True,
"very": True,
"via": True,
"was": True,
"we": True,
"well": True,
"were": True,
"what": True,
"whatever": True,
"when": True,
"whence": True,
"whenever": True,
"where": True,
"whereafter": True,
"whereas": True,
"whereby": True,
"wherein": True,
"whereupon": True,
"wherever": True,
"whether": True,
"which": True,
"while": True,
"whither": True,
"who": True,
"whoever": True,
"whole": True,
"whom": True,
"whose": True,
"why": True,
"will": True,
"with": True,
"within": True,
"without": True,
"would": True,
"yet": True,
"you": True,
"your": True,
"yours": True,
"yourself": True,
"yourselves": True
}

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

No branches or pull requests

1 participant