-
Notifications
You must be signed in to change notification settings - Fork 860
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Edit code to conform to JS standard (#572)
* Edited stemmers to comply with standard JS * Edited the tokenizers to comply with standard JS * fixed tests for removed attach() method * Brill's tagger conforms to standard JS * Classifiers in standard JS * Distance to standard JS * Inflectors to Standard JS * Ngrams to standard JS * Normalizers to standard JS * Phonetics to standard JS * Sentiment analyzer in standard JS * Spellcheck to standard JS * Add trie to standard JS * Util folder to standard JS * Wordnet to standard JS * index.js to standard js * sentence_analyse in standard JS * Tools of sentiment analyser to standard JS * Tests in io_spec conform to standard JS * io_spec conforms to standard JS * examples in standard JS * Specs to standard JS * Last files to conform to standard JS * Add linter to Github actions * Added standard JS badge to README * README for linter * Padding for license agreement * Attempt to repair url in README * Padding in license texts * Removed some code clones * Removed editor config * Repaired code duplicaties in specs * Excluded generated files for jscpd * Adapted path of ignore files for jscpd * Split classifier.js te prevent code duplication * Add new file for classifier * Repaired parallel trainer * Removed duplication from classifier spec * Repaired Bayes classifier * Repaired further... * Double metaphone test * Ignore TF_Parser
- Loading branch information
1 parent
4104219
commit f23ad2b
Showing
236 changed files
with
21,299 additions
and
18,184 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
########################### | ||
########################### | ||
## Linter GitHub Actions ## | ||
########################### | ||
########################### | ||
name: Lint Code Base | ||
|
||
# | ||
# Documentation: | ||
# https://help.github.com/en/articles/workflow-syntax-for-github-actions | ||
# | ||
|
||
############################# | ||
# Start the job on all push # | ||
############################# | ||
on: | ||
push: | ||
branches-ignore: [master] | ||
# Remove the line above to run when pushing to master | ||
pull_request: | ||
branches: [master] | ||
|
||
############### | ||
# Set the Job # | ||
############### | ||
jobs: | ||
build: | ||
# Name the Job | ||
name: Lint Code Base | ||
# Set the agent to run on | ||
runs-on: ubuntu-latest | ||
|
||
################## | ||
# Load all steps # | ||
################## | ||
steps: | ||
########################## | ||
# Checkout the code base # | ||
########################## | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
with: | ||
# Full git history is needed to get a proper list of changed files within `super-linter` | ||
fetch-depth: 0 | ||
|
||
################################ | ||
# Run Linter against code base # | ||
################################ | ||
- name: Lint Code Base | ||
uses: github/super-linter@v3 | ||
env: | ||
VALIDATE_ALL_CODEBASE: false | ||
DEFAULT_BRANCH: master | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
|
||
const fs = require('fs') | ||
const natural = require('../') | ||
const metaphone = natural.Metaphone.process | ||
|
||
/* global suite */ | ||
|
||
// single word | ||
|
||
suite.bench('metaphone() word', function(next){ | ||
metaphone('stephen'); | ||
next(); | ||
}); | ||
suite.bench('metaphone() word', function (next) { | ||
metaphone('stephen') | ||
next() | ||
}) | ||
|
||
// small body of text | ||
|
||
var words = fs.readFileSync('lib/natural/index.js', 'utf8').split(/\W+/); | ||
suite.bench('metaphone() small', function(next){ | ||
for (var i = 0, len = words.length; i < len; ++i) { | ||
metaphone(words[i]); | ||
const words = fs.readFileSync('lib/natural/index.js', 'utf8').split(/\W+/) | ||
suite.bench('metaphone() small', function (next) { | ||
for (let i = 0, len = words.length; i < len; ++i) { | ||
metaphone(words[i]) | ||
} | ||
next(); | ||
}); | ||
next() | ||
}) | ||
|
||
// medium body of text | ||
|
||
var words2 = fs.readFileSync('README.md', 'utf8').split(/\W+/); | ||
suite.bench('metaphone() medium', function(next){ | ||
for (var i = 0, len = words2.length; i < len; ++i) { | ||
metaphone(words2[i]); | ||
const words2 = fs.readFileSync('README.md', 'utf8').split(/\W+/) | ||
suite.bench('metaphone() medium', function (next) { | ||
for (let i = 0, len = words2.length; i < len; ++i) { | ||
metaphone(words2[i]) | ||
} | ||
next(); | ||
}); | ||
next() | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,32 @@ | ||
const fs = require('fs') | ||
const natural = require('../') | ||
const soundex = natural.SoundEx.process | ||
|
||
/* global suite */ | ||
|
||
// single word | ||
|
||
suite.bench('soundex() word', function(next){ | ||
soundex('stephen'); | ||
next(); | ||
}); | ||
suite.bench('soundex() word', function (next) { | ||
soundex('stephen') | ||
next() | ||
}) | ||
|
||
// small body of text | ||
|
||
var words = fs.readFileSync('lib/natural/index.js', 'utf8').split(/\W+/); | ||
suite.bench('soundex() small', function(next){ | ||
for (var i = 0, len = words.length; i < len; ++i) { | ||
soundex(words[i]); | ||
const words = fs.readFileSync('lib/natural/index.js', 'utf8').split(/\W+/) | ||
suite.bench('soundex() small', function (next) { | ||
for (let i = 0, len = words.length; i < len; ++i) { | ||
soundex(words[i]) | ||
} | ||
next(); | ||
}); | ||
next() | ||
}) | ||
|
||
// medium body of text | ||
|
||
var words2 = fs.readFileSync('README.md', 'utf8').split(/\W+/); | ||
suite.bench('soundex() medium', function(next){ | ||
for (var i = 0, len = words2.length; i < len; ++i) { | ||
soundex(words2[i]); | ||
const words2 = fs.readFileSync('README.md', 'utf8').split(/\W+/) | ||
suite.bench('soundex() medium', function (next) { | ||
for (let i = 0, len = words2.length; i < len; ++i) { | ||
soundex(words2[i]) | ||
} | ||
next(); | ||
}); | ||
next() | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
const fs = require('fs') | ||
const natural = require('../') | ||
const stemmerId = natural.StemmerId | ||
|
||
var words = fs.readFileSync('benchmarks/sample-id.txt', 'utf8').split(/\W+/); | ||
suite.bench('stemmerId() sample text', function(next){ | ||
for (var i = 0, len = words.length; i < len; ++i) { | ||
stemmerId.stem(words[i]); | ||
/* global suite */ | ||
|
||
const words = fs.readFileSync('benchmarks/sample-id.txt', 'utf8').split(/\W+/) | ||
suite.bench('stemmerId() sample text', function (next) { | ||
for (let i = 0, len = words.length; i < len; ++i) { | ||
stemmerId.stem(words[i]) | ||
} | ||
next(); | ||
}); | ||
next() | ||
}) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.