natural 0.5.6 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +2 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/natural.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +511 -0
- package/.travis.yml +8 -1
- package/README.md +331 -40
- package/bayes_classifier.json +1 -1
- package/classifier.json +418 -0
- package/lib/natural/brill_pos_tagger/lib/Brill_POS_Tagger.js +8 -9
- package/lib/natural/brill_pos_tagger/lib/Brill_POS_Tester.js +5 -5
- package/lib/natural/brill_pos_tagger/lib/Brill_POS_Trainer.js +10 -6
- package/lib/natural/brill_pos_tagger/lib/Corpus.js +21 -16
- package/lib/natural/brill_pos_tagger/lib/Lexicon.js +22 -13
- package/lib/natural/brill_pos_tagger/lib/Predicate.js +2 -2
- package/lib/natural/brill_pos_tagger/lib/RuleTemplate.js +2 -2
- package/lib/natural/brill_pos_tagger/lib/RuleTemplates.js +132 -146
- package/lib/natural/brill_pos_tagger/lib/Sentence.js +41 -0
- package/lib/natural/brill_pos_tagger/lib/TransformationRule.js +10 -11
- package/lib/natural/classifiers/classifier.js +5 -3
- package/lib/natural/classifiers/maxent/Classifier.js +125 -0
- package/lib/natural/classifiers/maxent/Context.js +33 -0
- package/lib/natural/classifiers/maxent/Distribution.js +145 -0
- package/lib/natural/classifiers/maxent/Element.js +34 -0
- package/lib/natural/classifiers/maxent/Feature.js +88 -0
- package/lib/natural/classifiers/maxent/FeatureSet.js +67 -0
- package/lib/natural/classifiers/maxent/GISScaler.js +148 -0
- package/lib/natural/classifiers/maxent/POS/ME_Corpus.js +56 -0
- package/lib/natural/classifiers/maxent/POS/ME_Sentence.js +73 -0
- package/lib/natural/classifiers/maxent/POS/POS_Element.js +172 -0
- package/lib/natural/classifiers/maxent/Sample.js +141 -0
- package/lib/natural/classifiers/maxent/SimpleExample/SE_Element.js +49 -0
- package/lib/natural/distance/hamming_distance.js +52 -0
- package/lib/natural/distance/jaro-winkler_distance.js +16 -6
- package/lib/natural/distance/levenshtein_distance.js +2 -2
- package/lib/natural/index.js +21 -2
- package/lib/natural/inflectors/noun_inflector.js +5 -3
- package/lib/natural/ngrams/ngrams.js +83 -25
- package/lib/natural/sentiment/Basque/senticon_eu.json +21557 -0
- package/lib/natural/sentiment/Catalan/senticon_ca.json +36352 -0
- package/lib/natural/sentiment/Dutch/negations_du.json +3 -0
- package/lib/natural/sentiment/Dutch/pattern-sentiment-nl.json +39650 -0
- package/lib/natural/sentiment/English/negations_en.json +3 -0
- package/lib/natural/sentiment/English/pattern-sentiment-en.json +16024 -0
- package/lib/natural/sentiment/English/senticon_en.json +124197 -0
- package/lib/natural/sentiment/French/pattern-sentiment-fr.json +40906 -0
- package/lib/natural/sentiment/Galician/senticon_gl.json +24427 -0
- package/lib/natural/sentiment/Italian/pattern-sentiment-it.json +24522 -0
- package/lib/natural/sentiment/SentimentAnalyzer.js +116 -0
- package/lib/natural/sentiment/Spanish/afinnShortSortedSpanish.json +1655 -0
- package/lib/natural/sentiment/Spanish/negations_es.json +3 -0
- package/lib/natural/sentiment/Spanish/senticon_es.json +56722 -0
- package/lib/natural/sentiment/tools/README.md +31 -0
- package/lib/natural/sentiment/tools/XmlParser4PatternData.js +31 -0
- package/lib/natural/sentiment/tools/sentimentXmlParser.js +30 -0
- package/lib/natural/stemmers/indonesian/data/kata-dasar.json +29935 -0
- package/lib/natural/stemmers/indonesian/prefix_rules.js +10 -9
- package/lib/natural/stemmers/indonesian/stemmer_id.js +16 -15
- package/lib/natural/stemmers/indonesian/suffix_rules.js +2 -2
- package/lib/natural/stemmers/porter_stemmer_es.js +265 -199
- package/lib/natural/stemmers/porter_stemmer_fr.js +1 -1
- package/lib/natural/stemmers/porter_stemmer_nl.js +362 -0
- package/lib/natural/stemmers/stemmer_es.js +18 -12
- package/lib/natural/stemmers/stemmer_nl.js +64 -0
- package/lib/natural/tfidf/tfidf.js +27 -4
- package/lib/natural/tokenizers/aggressive_tokenizer_sv.js +1 -1
- package/lib/natural/tokenizers/aggressive_tokenizer_vi.js +37 -0
- package/lib/natural/tokenizers/orthography_matchers.js +33 -0
- package/lib/natural/tokenizers/regexp_tokenizer.js +24 -4
- package/lib/natural/tokenizers/sentence_tokenizer.js +1 -1
- package/lib/natural/wordnet/wordnet_file.js +7 -1
- package/lr_classifier.json +1 -1
- package/package.json +35 -23
- package/.npmignore +0 -4
- package/.vscode/temp.sql +0 -0
- package/Makefile +0 -38
- package/data/kata-dasar.txt +0 -29933
- package/package-lock.json +0 -79
- package/tests/stemmer_id_test.js +0 -361
|
@@ -53,7 +53,13 @@ function open(callback) {
|
|
|
53
53
|
console.log('Unable to open %s', filePath);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
callback(err, fd, function() {
|
|
56
|
+
callback(err, fd, function() {
|
|
57
|
+
fs.close(fd, function(error) {
|
|
58
|
+
if (error) {
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
});
|
|
57
63
|
});
|
|
58
64
|
}
|
|
59
65
|
|
package/lr_classifier.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"classifier":{"examples":{"computing":[[1,1,0,0,0,0,0,0,0],[0,0,1,1,0,0,0,0,0],[0,0,0,1,1,1,0,0,0]],"literature":[[0,0,1,0,0,0,1,0,0],[0,0,0,0,0,0,1,1,0],[0,0,0,0,0,0,1,0,1]]},"features":[],"featurePositions":{},"maxFeaturePosition":0,"classifications":["computing","literature"],"exampleCount":6,"theta":[{"elements":[2.0057203693422903,2.0057203693422903,0.0904766662626176,3.447364098636818,0.9696521506748157,0.9696521506748157,-4.840706080886848,-1.2267353995937322,-1.2267353995937322]},{"elements":[-2.0057203693422894,-2.0057203693422894,-0.09047666626261801,-3.4473640986368186,-0.9696521506748156,-0.9696521506748156,4.84070608088685,1.2267353995937313,1.2267353995937313]}]},"docs":[{"label":"computing","text":["fix","box"]},{"label":"computing","text":["write","code"]},{"label":"computing","text":["nasti","script","code"]},{"label":"literature","text":["write","book"]},{"label":"literature","text":["read","book"]},{"label":"literature","text":["studi","book"]}],"features":{"fix":1,"box":1,"write":2,"code":2,"nasti":1,"script":1,"book":3,"read":1,"studi":1},"stemmer":{},"lastAdded":6,"events":{"
|
|
1
|
+
{"classifier":{"examples":{"computing":[[1,1,0,0,0,0,0,0,0],[0,0,1,1,0,0,0,0,0],[0,0,0,1,1,1,0,0,0]],"literature":[[0,0,1,0,0,0,1,0,0],[0,0,0,0,0,0,1,1,0],[0,0,0,0,0,0,1,0,1]]},"features":[],"featurePositions":{},"maxFeaturePosition":0,"classifications":["computing","literature"],"exampleCount":6,"theta":[{"elements":[2.0057203693422903,2.0057203693422903,0.0904766662626176,3.447364098636818,0.9696521506748157,0.9696521506748157,-4.840706080886848,-1.2267353995937322,-1.2267353995937322]},{"elements":[-2.0057203693422894,-2.0057203693422894,-0.09047666626261801,-3.4473640986368186,-0.9696521506748156,-0.9696521506748156,4.84070608088685,1.2267353995937313,1.2267353995937313]}]},"docs":[{"label":"computing","text":["fix","box"]},{"label":"computing","text":["write","code"]},{"label":"computing","text":["nasti","script","code"]},{"label":"literature","text":["write","book"]},{"label":"literature","text":["read","book"]},{"label":"literature","text":["studi","book"]}],"features":{"fix":1,"box":1,"write":2,"code":2,"nasti":1,"script":1,"book":3,"read":1,"studi":1},"stemmer":{},"lastAdded":6,"events":{"_events":{},"_eventsCount":0}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natural",
|
|
3
|
-
"description": "General natural language (tokenizing, stemming (English, Russian, Spanish), classification, inflection, phonetics, tfidf, WordNet, jaro-winkler, Levenshtein distance, Dice's Coefficient) facilities for node.",
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "General natural language (tokenizing, stemming (English, Russian, Spanish), part-of-speech tagging, sentiment analysis, classification, inflection, phonetics, tfidf, WordNet, jaro-winkler, Levenshtein distance, Dice's Coefficient) facilities for node.",
|
|
4
|
+
"version": "0.6.3",
|
|
5
5
|
"homepage": "https://github.com/NaturalNode/natural",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -11,46 +11,58 @@
|
|
|
11
11
|
"node": ">=0.4.10"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
14
|
+
"afinn-165": "^1.0.2",
|
|
15
|
+
"apparatus": "^0.0.10",
|
|
16
|
+
"json-stable-stringify": "^1.0.1",
|
|
17
|
+
"sylvester": "^0.0.12",
|
|
18
|
+
"underscore": "^1.3.1"
|
|
17
19
|
},
|
|
18
20
|
"devDependencies": {
|
|
19
|
-
"
|
|
20
|
-
"jasmine-node": "~1.13.1",
|
|
21
|
+
"jasmine-node": "^1.13.1",
|
|
21
22
|
"proxyquire": "^1.8.0",
|
|
23
|
+
"rimraf": "^2.6.2",
|
|
22
24
|
"sinon": "^1.12.2",
|
|
23
|
-
"uubench": "0.0.
|
|
24
|
-
},
|
|
25
|
-
"optionalDependencies": {
|
|
26
|
-
"webworker-threads": ">=0.6.2"
|
|
25
|
+
"uubench": "^0.0.1"
|
|
27
26
|
},
|
|
28
27
|
"scripts": {
|
|
29
|
-
"
|
|
28
|
+
"benchmark": "node benchmarks",
|
|
29
|
+
"clean": "rimraf *~ #* *classifier.json",
|
|
30
|
+
"test": "NODE_PATH=. node_modules/jasmine-node/bin/jasmine-node spec/",
|
|
31
|
+
"test_io": "NODE_PATH=. node_modules/jasmine-node/bin/jasmine-node io_spec/",
|
|
32
|
+
"test_io_unclean": "NODE_PATH=. node_modules/jasmine-node/bin/jasmine-node io_spec/"
|
|
30
33
|
},
|
|
31
34
|
"license": "MIT",
|
|
32
35
|
"author": "Chris Umbel <chris@chrisumbel.com>",
|
|
33
36
|
"keywords": [
|
|
34
|
-
"natural",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
37
|
+
"natural language processing",
|
|
38
|
+
"artifical intelligence",
|
|
39
|
+
"statistics",
|
|
40
|
+
"Porter stemmer",
|
|
41
|
+
"Lancaster stemmer",
|
|
42
|
+
"tokenizer",
|
|
43
|
+
"bigram",
|
|
44
|
+
"trigram",
|
|
45
|
+
"quadgram",
|
|
46
|
+
"ngram",
|
|
38
47
|
"stemmer",
|
|
39
48
|
"bayes",
|
|
40
49
|
"classifier",
|
|
41
50
|
"phonetic",
|
|
42
51
|
"metaphone",
|
|
43
52
|
"inflector",
|
|
44
|
-
"
|
|
53
|
+
"Wordnet",
|
|
45
54
|
"tf-idf",
|
|
46
|
-
"logistic",
|
|
47
|
-
"regression",
|
|
55
|
+
"logistic regression",
|
|
48
56
|
"doublemetaphone",
|
|
49
57
|
"double",
|
|
50
|
-
"jaro-winkler",
|
|
51
|
-
"levenshtein",
|
|
52
|
-
"distance",
|
|
53
|
-
"tagger"
|
|
58
|
+
"jaro-winkler distance",
|
|
59
|
+
"levenshtein distance",
|
|
60
|
+
"string distance",
|
|
61
|
+
"part-of-speech tagger",
|
|
62
|
+
"Eric Brill",
|
|
63
|
+
"Brill tagger",
|
|
64
|
+
"sentiment analysis",
|
|
65
|
+
"maximum entropy modelling"
|
|
54
66
|
],
|
|
55
67
|
"main": "./lib/natural/index.js",
|
|
56
68
|
"maintainers": [
|
package/.npmignore
DELETED
package/.vscode/temp.sql
DELETED
|
File without changes
|
package/Makefile
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2011, Chris Umbel
|
|
2
|
-
|
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
# furnished to do so, subject to the following conditions:
|
|
9
|
-
|
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
|
11
|
-
# all copies or substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
# THE SOFTWARE.
|
|
20
|
-
|
|
21
|
-
SHELL := /bin/bash
|
|
22
|
-
|
|
23
|
-
benchmark:
|
|
24
|
-
@node benchmarks
|
|
25
|
-
|
|
26
|
-
clean:
|
|
27
|
-
@find ./ -name *~ | xargs rm -f
|
|
28
|
-
@find ./ -name \#* | xargs rm -f
|
|
29
|
-
@rm *classifier.json
|
|
30
|
-
|
|
31
|
-
test:
|
|
32
|
-
@NODE_PATH=. node_modules/jasmine-node/bin/jasmine-node spec/
|
|
33
|
-
|
|
34
|
-
test_io:
|
|
35
|
-
@NODE_PATH=. node_modules/jasmine-node/bin/jasmine-node io_spec/
|
|
36
|
-
|
|
37
|
-
test_io_unclean:
|
|
38
|
-
@NODE_PATH=. node_modules/jasmine-node/bin/jasmine-node io_spec/
|