natural 6.3.0 → 6.5.0
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.
|
@@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
23
23
|
THE SOFTWARE.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import Tokenizer from '../tokenizers
|
|
26
|
+
import { Tokenizer } from '../tokenizers'
|
|
27
27
|
|
|
28
28
|
declare type TfIdfCallback = (i: number, measure: number, key?: string) => void
|
|
29
29
|
|
|
@@ -34,7 +34,7 @@ util.inherits(SentenceTokenizer, Tokenizer)
|
|
|
34
34
|
|
|
35
35
|
SentenceTokenizer.prototype.tokenize = function (text) {
|
|
36
36
|
// break string up in to sentences based on punctation and quotation marks
|
|
37
|
-
let tokens = text.match(/(?<=\s+|^)["'‘“'"[({⟨]?(.*?[
|
|
37
|
+
let tokens = text.match(/(?<=\s+|^)["'‘“'"[({⟨]?(.*?[.?!…]|[^.?!…]+)(\s[.?!…])*["'’”'"\])}⟩]?(?=\s+|$)/g)
|
|
38
38
|
|
|
39
39
|
DEBUG && console.log('SentenceTokenizer.tokenize: ' + tokens)
|
|
40
40
|
|
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.5.0",
|
|
5
5
|
"homepage": "https://github.com/NaturalNode/natural",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|