de-compromise 0.1.0 → 0.1.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/builds/de-compromise.cjs +139 -69
- package/builds/de-compromise.min.js +1 -1
- package/builds/de-compromise.mjs +1 -1
- package/package.json +35 -23
- package/src/_version.js +1 -1
- package/types/index.d.ts +1 -2
- package/types/view/de.ts +17 -17
package/package.json
CHANGED
|
@@ -2,17 +2,21 @@
|
|
|
2
2
|
"author": "Spencer Kelly <spencermountain@gmail.com> (http://spencermounta.in)",
|
|
3
3
|
"name": "de-compromise",
|
|
4
4
|
"description": "Computerlinguistik im browser",
|
|
5
|
-
"version": "0.1.
|
|
6
|
-
"
|
|
5
|
+
"version": "0.1.1",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": "^22.13.0 || ^24.0.0 || ^26.0.0",
|
|
8
|
+
"pnpm": "^11.5.0"
|
|
9
|
+
},
|
|
10
|
+
"main": "./builds/de-compromise.mjs",
|
|
7
11
|
"browser": "./builds/de-compromise.min.js",
|
|
8
12
|
"unpkg": "./builds/de-compromise.min.js",
|
|
9
13
|
"type": "module",
|
|
10
14
|
"sideEffects": false,
|
|
11
15
|
"exports": {
|
|
12
16
|
".": {
|
|
17
|
+
"types": "./types/index.d.ts",
|
|
13
18
|
"import": "./builds/de-compromise.mjs",
|
|
14
|
-
"require": "./builds/de-compromise.cjs"
|
|
15
|
-
"types": "./types/index.d.ts"
|
|
19
|
+
"require": "./builds/de-compromise.cjs"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
"types": "types/index.d.ts",
|
|
@@ -25,36 +29,44 @@
|
|
|
25
29
|
"types/",
|
|
26
30
|
"src/"
|
|
27
31
|
],
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"score": " node ./learn/test/index.js",
|
|
35
|
-
"lint": "eslint ./src/**/*",
|
|
36
|
-
"watch": "amble ./scratch.js",
|
|
37
|
-
"stress": "node scripts/stress.js",
|
|
38
|
-
"match": "node scripts/match.js"
|
|
32
|
+
"prettier": {
|
|
33
|
+
"trailingComma": "none",
|
|
34
|
+
"tabWidth": 2,
|
|
35
|
+
"semi": false,
|
|
36
|
+
"singleQuote": true,
|
|
37
|
+
"printWidth": 100
|
|
39
38
|
},
|
|
40
39
|
"dependencies": {
|
|
41
|
-
"compromise": "14.
|
|
40
|
+
"compromise": "^14.17.0",
|
|
42
41
|
"efrt": "2.7.0",
|
|
43
|
-
"suffix-thumb": "5.0.
|
|
42
|
+
"suffix-thumb": "5.0.3"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
45
|
"@eslint/js": "^10.0.1",
|
|
47
46
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
48
47
|
"@rollup/plugin-terser": "1.0.0",
|
|
49
|
-
"amble": "1.3.0",
|
|
50
48
|
"cross-env": "10.1.0",
|
|
51
49
|
"de-corpus": "0.0.1",
|
|
52
|
-
"eslint": "10.
|
|
53
|
-
"eslint-plugin-regexp": "3.
|
|
50
|
+
"eslint": "10.10.0",
|
|
51
|
+
"eslint-plugin-regexp": "3.3.0",
|
|
54
52
|
"globals": "^17.7.0",
|
|
55
|
-
"rollup": "4.
|
|
53
|
+
"rollup": "4.63.1",
|
|
56
54
|
"tap-dancer": "0.3.4",
|
|
57
|
-
"tape": "5.10.2"
|
|
55
|
+
"tape": "5.10.2",
|
|
56
|
+
"typescript": "7.0.2"
|
|
58
57
|
},
|
|
59
|
-
"license": "MIT"
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"scripts": {
|
|
60
|
+
"test": "pnpm run check-types && tape \"./tests/**/*.test.js\" | tap-dancer",
|
|
61
|
+
"check-types": "tsc -p tsconfig.json",
|
|
62
|
+
"testb": "cross-env TESTENV=prod pnpm run test",
|
|
63
|
+
"build": "pnpm run version && rollup -c --silent",
|
|
64
|
+
"version": "node ./scripts/version.js",
|
|
65
|
+
"pack": "node ./scripts/pack.js",
|
|
66
|
+
"score": " node ./learn/test/index.js",
|
|
67
|
+
"lint": "eslint ./src/**/*",
|
|
68
|
+
"watch": "node --watch ./scratch.js",
|
|
69
|
+
"stress": "node scripts/stress.js",
|
|
70
|
+
"match": "node scripts/match.js"
|
|
71
|
+
}
|
|
60
72
|
}
|
package/src/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '0.1.
|
|
1
|
+
export default '0.1.1'
|
package/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import View from './view/de'
|
|
|
5
5
|
declare function nlp(text: string, lexicon?: Lexicon): View
|
|
6
6
|
|
|
7
7
|
// Constructor
|
|
8
|
-
declare
|
|
8
|
+
declare namespace nlp {
|
|
9
9
|
/** interpret text without tagging */
|
|
10
10
|
export function tokenize(text: string, lexicon?: Lexicon): View
|
|
11
11
|
/** scan through text with minimal analysis */
|
|
@@ -43,4 +43,3 @@ declare module nlp {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export default nlp
|
|
46
|
-
|
package/types/view/de.ts
CHANGED
|
@@ -9,37 +9,37 @@ interface Numbers extends View {
|
|
|
9
9
|
/** grab 'kilos' from `25 kilos' */
|
|
10
10
|
// units: () => View
|
|
11
11
|
/** return only ordinal numbers */
|
|
12
|
-
isOrdinal: () =>
|
|
12
|
+
isOrdinal: () => Numbers
|
|
13
13
|
/** return only cardinal numbers */
|
|
14
|
-
isCardinal: () =>
|
|
14
|
+
isCardinal: () => Numbers
|
|
15
15
|
/** convert number to `5` or `5th` */
|
|
16
|
-
toNumber: () =>
|
|
16
|
+
toNumber: () => Numbers
|
|
17
17
|
/** add commas, or nicer formatting for numbers */
|
|
18
|
-
toLocaleString: () =>
|
|
18
|
+
toLocaleString: () => Numbers
|
|
19
19
|
/** convert number to `five` or `fifth` */
|
|
20
|
-
toText: () =>
|
|
20
|
+
toText: () => Numbers
|
|
21
21
|
/** convert number to `five` or `5` */
|
|
22
|
-
toCardinal: () =>
|
|
22
|
+
toCardinal: () => Numbers
|
|
23
23
|
/** convert number to `fifth` or `5th` */
|
|
24
|
-
toOrdinal: () =>
|
|
24
|
+
toOrdinal: () => Numbers
|
|
25
25
|
/** return numbers with this value */
|
|
26
|
-
isEqual: () =>
|
|
26
|
+
isEqual: () => Numbers
|
|
27
27
|
/** return numbers bigger than n */
|
|
28
|
-
greaterThan: (min: number) =>
|
|
28
|
+
greaterThan: (min: number) => Numbers
|
|
29
29
|
/** return numbers smaller than n */
|
|
30
|
-
lessThan: (max: number) =>
|
|
30
|
+
lessThan: (max: number) => Numbers
|
|
31
31
|
/** return numbers between min and max */
|
|
32
|
-
between: (min: number, max: number) =>
|
|
32
|
+
between: (min: number, max: number) => Numbers
|
|
33
33
|
/** set number to n */
|
|
34
|
-
set: (n: number) =>
|
|
34
|
+
set: (n: number) => Numbers
|
|
35
35
|
/** increase number by n */
|
|
36
|
-
add: (n: number) =>
|
|
36
|
+
add: (n: number) => Numbers
|
|
37
37
|
/** decrease number by n*/
|
|
38
|
-
subtract: (n: number) =>
|
|
38
|
+
subtract: (n: number) => Numbers
|
|
39
39
|
/** increase number by 1 */
|
|
40
|
-
increment: () =>
|
|
40
|
+
increment: () => Numbers
|
|
41
41
|
/** decrease number by 1*/
|
|
42
|
-
decrement: () =>
|
|
42
|
+
decrement: () => Numbers
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
interface Contractions extends View {
|
|
@@ -58,4 +58,4 @@ interface FrView extends View {
|
|
|
58
58
|
topics(): View
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export default FrView
|
|
61
|
+
export default FrView
|