natural 6.6.0 → 6.7.1
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/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
[](https://bestpractices.coreinfrastructure.org/projects/4651)
|
|
9
9
|
[](https://www.typescriptlang.org/)
|
|
10
10
|
|
|
11
|
-
"Natural" is a general natural language facility for nodejs. It offers a broad range of functionalities for natural language processing. Documentation can be found [here on GitHub Pages](
|
|
11
|
+
"Natural" is a general natural language facility for nodejs. It offers a broad range of functionalities for natural language processing. Documentation can be found [here on GitHub Pages](https://naturalnode.github.io/natural/).
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
## Open source licenses
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
file aggressive_tokenizer_hi.js , located at lib\natural\tokenizers\aggressive_tokenizer_hi.js is licensed as follows:
|
|
3
|
+
- (The MIT License)
|
|
4
|
+
- Copyright (c) 2023 Mukesh Singh Bisht
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person or entity obtaining a copy
|
|
7
|
+
of file aggressive_tokenizer_hi.js and its content(the "Software"), to deal in the
|
|
8
|
+
Software without restriction, including without limitation the rights to use, copy,
|
|
9
|
+
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
|
10
|
+
and to permit persons to whom the Software is furnished to do so, subject to the following
|
|
11
|
+
conditions:
|
|
12
|
+
|
|
13
|
+
1. The above copyright notice and this permission notice shall be included in all copies
|
|
14
|
+
or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
2. Proper credit must be given to the original author Mukesh Singh Bisht, along with the
|
|
17
|
+
date of authorship specified as July 23, 2023, in any usage, distribution, or
|
|
18
|
+
modification of the Software.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
21
|
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
22
|
+
PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
|
23
|
+
FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR
|
|
24
|
+
OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
25
|
+
DEALINGS IN THE SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
'use strict'
|
|
29
|
+
|
|
30
|
+
const Tokenizer = require('./tokenizer')
|
|
31
|
+
const util = require('util')
|
|
32
|
+
|
|
33
|
+
const AggressiveTokenizer = function () {
|
|
34
|
+
Tokenizer.call(this)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
util.inherits(AggressiveTokenizer, Tokenizer)
|
|
38
|
+
|
|
39
|
+
/*
|
|
40
|
+
To know more on hindi
|
|
41
|
+
Important links:
|
|
42
|
+
1.https://viahindi.in/hindi-vyakaran/%E0%A4%B8%E0%A4%AE%E0%A4%BE%E0%A4%B8-samas-in-hindi
|
|
43
|
+
2.https://hindigrammar.in/
|
|
44
|
+
3.https://www.unicode.org/charts/PDF/U0900.pdf
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
AggressiveTokenizer.prototype.tokenize = function (text) {
|
|
48
|
+
const response = this.trim(text.replace(/[\u0964\u0965...?,]/g, '').split(/\s+|(?![\u0900-\u097F\u0020-\u007F])./u)).filter(Boolean)
|
|
49
|
+
return response
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
module.exports = AggressiveTokenizer
|
|
@@ -83,6 +83,10 @@ export class AggressiveTokenizerId extends Tokenizer {
|
|
|
83
83
|
tokenize (text: string): string[]
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
export class AggressiveTokenizerHi extends Tokenizer {
|
|
87
|
+
tokenize (text: string): string[]
|
|
88
|
+
}
|
|
89
|
+
|
|
86
90
|
export class AggressiveTokenizer extends Tokenizer {
|
|
87
91
|
tokenize (text: string): string[]
|
|
88
92
|
}
|
|
@@ -35,6 +35,7 @@ exports.AggressiveTokenizerNo = require('./aggressive_tokenizer_no')
|
|
|
35
35
|
exports.AggressiveTokenizerSv = require('./aggressive_tokenizer_sv')
|
|
36
36
|
exports.AggressiveTokenizerVi = require('./aggressive_tokenizer_vi')
|
|
37
37
|
exports.AggressiveTokenizerId = require('./aggressive_tokenizer_id')
|
|
38
|
+
exports.AggressiveTokenizerHi = require('./aggressive_tokenizer_hi')
|
|
38
39
|
exports.AggressiveTokenizer = require('./aggressive_tokenizer')
|
|
39
40
|
exports.CaseTokenizer = require('./tokenizer_case')
|
|
40
41
|
exports.RegexpTokenizer = require('./regexp_tokenizer').RegexpTokenizer
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natural",
|
|
3
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": "6.
|
|
4
|
+
"version": "6.7.1",
|
|
5
5
|
"homepage": "https://github.com/NaturalNode/natural",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|