Added ability to use library in webbrowser with requiring stopwords files#84
Open
ageitgey wants to merge 1 commit intoageitgey:masterfrom
Open
Added ability to use library in webbrowser with requiring stopwords files#84ageitgey wants to merge 1 commit intoageitgey:masterfrom
ageitgey wants to merge 1 commit intoageitgey:masterfrom
Conversation
|
Go ahead, fine for me |
mazmazz
reviewed
Oct 16, 2018
| # and then returns which of those words exist in the given content | ||
| module.exports = stopwords = (content, language = 'en') -> | ||
| filePath = getFilePath(language) | ||
| hasFs = 'existsSync' in fs |
There was a problem hiding this comment.
I suggest this line should be hasFs = fs and fs.existsSync.
The current line fails because the compiled JavaScript line treats fs as an array with length, and fs.length does not exist:
function in$(member, list) {
for (var i = 0, length = list.length; i < length; ++i) // <-- failure at list.length
if (i in list && list[i] === member)
return true;
return false;
}
hasFs = in$('existsSync', fs);The proposed change succeeds in JavaScript as hasFs = fs && fs.existsSync. This should fix the buildbots.
I would PR to the branch myself, but I'm unfamiliar with CoffeeScript and can't build.
|
Maybe drop # en.coffee
module.exports = [
"a's",
"able",
# ... etc.
]stopwords = require(language) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a PR of a commit from @cjanietz
@cjanietz are you ok with me pulling this in?