Skip to content

Commit

Permalink
Merge pull request #15 from komodojp/deno
Browse files Browse the repository at this point in the history
Fix deno issue, Node ESM import and few issues
  • Loading branch information
kefniark authored Jul 23, 2022
2 parents 251b89f + 9c54543 commit 793f87f
Show file tree
Hide file tree
Showing 43 changed files with 33,029 additions and 34,099 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
bin
dist
tests
tests-integration
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '14.x'
node-version: '18.x'
- run: |
yarn
yarn build
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ config
*.log
package.json
package-lock.json
tests-integration
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- Pure JS, No api call, No dependencies (Node and Browser compatible)
- Blazing fast and low memory footprint (unlike ML methods)
- Train with dataset from [Tatoeba](https://tatoeba.org/en/) and [UDHR](https://unicode.org/udhr/)
- Support [64 languages](./docs/langs.md) (24 for [the web version](./docs/light.md))
- Support [62 languages](./docs/langs.md) (24 for [the web version](./docs/light.md))
- Reliable even for really short texts (chatbot, keywords, ...)
- Support both ISO-639-1 & ISO-639-2
- Available for both `CommonJS` and `ESM`
Expand Down
2 changes: 1 addition & 1 deletion bin/tinyld.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env node
const { detectAll } = require('../dist/tinyld.cjs')
const { detectAll } = require('../dist/tinyld.normal.node.js')

function main() {
const [, , ...args] = process.argv
Expand Down
32 changes: 16 additions & 16 deletions data/bench/cld.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,64 @@
"success_rate": 36.375,
"error_rate": 3.25,
"unindentified_rate": 60.375,
"execution_time": 0.076
"execution_time": 0.0794
},
"24": {
"success_rate": 77.7188,
"error_rate": 3.0313,
"unindentified_rate": 19.25,
"execution_time": 0.0566
"execution_time": 0.0572
},
"36": {
"success_rate": 92.8125,
"error_rate": 1.75,
"unindentified_rate": 5.4375,
"execution_time": 0.057
"execution_time": 0.0577
},
"48": {
"success_rate": 96.75,
"error_rate": 1.0938,
"unindentified_rate": 2.1563,
"execution_time": 0.0582
"execution_time": 0.0579
},
"64": {
"success_rate": 98.2813,
"success_rate": 98.3125,
"error_rate": 0.5,
"unindentified_rate": 1.2188,
"execution_time": 0.0594
"unindentified_rate": 1.1875,
"execution_time": 0.0586
},
"128": {
"success_rate": 99.5625,
"error_rate": 0.0938,
"unindentified_rate": 0.3438,
"execution_time": 0.0608
"execution_time": 0.0629
},
"256": {
"success_rate": 99.9375,
"error_rate": 0.0313,
"unindentified_rate": 0.0313,
"execution_time": 0.0672
"execution_time": 0.0688
},
"512": {
"success_rate": 99.9688,
"error_rate": 0,
"unindentified_rate": 0.0313,
"execution_time": 0.0797
"execution_time": 0.0827
},
"1024": {
"success_rate": 100,
"error_rate": 0,
"unindentified_rate": 0,
"execution_time": 0.1063
"execution_time": 0.1096
}
},
"stats": {
"min": 78.39,
"max": 100,
"success_rate": 92.3097,
"error_rate": 1.6328,
"unindentified_rate": 6.0574,
"execution_time": 0.0566
"success_rate": 92.315,
"error_rate": 1.6319,
"unindentified_rate": 6.0532,
"execution_time": 0.0565
},
"languages": {
"jpn": 100,
Expand All @@ -78,7 +78,7 @@
"nld": 89.58,
"spa": 87.79,
"ita": 85.9,
"heb": 84.05,
"heb": 84.06,
"ara": 78.39
}
}
56 changes: 28 additions & 28 deletions data/bench/franc-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,78 @@
"success_rate": 18.5313,
"error_rate": 35,
"unindentified_rate": 46.4688,
"execution_time": 0.0918
"execution_time": 0.088
},
"24": {
"success_rate": 48.4375,
"error_rate": 51.5625,
"unindentified_rate": 0,
"execution_time": 0.2222
"execution_time": 0.215
},
"36": {
"success_rate": 60.625,
"error_rate": 39.375,
"success_rate": 60.5938,
"error_rate": 39.4063,
"unindentified_rate": 0,
"execution_time": 0.2974
"execution_time": 0.2977
},
"48": {
"success_rate": 69.5938,
"error_rate": 30.4063,
"success_rate": 69.5625,
"error_rate": 30.4375,
"unindentified_rate": 0,
"execution_time": 0.3688
"execution_time": 0.3563
},
"64": {
"success_rate": 73.5625,
"error_rate": 26.4375,
"success_rate": 73.5938,
"error_rate": 26.4062,
"unindentified_rate": 0,
"execution_time": 0.4389
"execution_time": 0.4264
},
"128": {
"success_rate": 86.0938,
"error_rate": 13.9063,
"success_rate": 86.1563,
"error_rate": 13.8438,
"unindentified_rate": 0,
"execution_time": 0.6776
"execution_time": 0.6821
},
"256": {
"success_rate": 93.6875,
"error_rate": 6.3125,
"unindentified_rate": 0,
"execution_time": 1.2104
"execution_time": 1.1989
},
"512": {
"success_rate": 96.3125,
"error_rate": 3.6875,
"success_rate": 96.25,
"error_rate": 3.75,
"unindentified_rate": 0,
"execution_time": 2.0938
"execution_time": 2.0734
},
"1024": {
"success_rate": 98.381,
"error_rate": 1.619,
"success_rate": 98.4147,
"error_rate": 1.5853,
"unindentified_rate": 0,
"execution_time": 3.57
"execution_time": 3.5626
}
},
"stats": {
"min": 29.47,
"max": 99.93,
"success_rate": 66.4673,
"error_rate": 33.5327,
"success_rate": 66.4893,
"error_rate": 33.5107,
"unindentified_rate": 0,
"execution_time": 0.3525
"execution_time": 0.3376
},
"languages": {
"jpn": 99.93,
"kor": 99.8261,
"kor": 99.83,
"cmn": 99.35,
"heb": 98.18,
"ara": 91.73,
"deu": 80.77,
"fin": 70.8,
"fra": 67.27,
"hin": 60.4,
"nld": 59.65,
"hin": 60.42,
"nld": 59.64,
"rus": 51.94,
"eng": 49.88,
"eng": 49.9,
"por": 49.39,
"ita": 42.55,
"tur": 32.27,
Expand Down
58 changes: 29 additions & 29 deletions data/bench/franc-min.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,80 +4,80 @@
"success_rate": 21.4375,
"error_rate": 29.375,
"unindentified_rate": 49.1875,
"execution_time": 0.0184
"execution_time": 0.0171
},
"24": {
"success_rate": 53.25,
"error_rate": 40.5,
"success_rate": 53.2188,
"error_rate": 40.5313,
"unindentified_rate": 6.25,
"execution_time": 0.0369
"execution_time": 0.0387
},
"36": {
"success_rate": 66.9375,
"error_rate": 26.8125,
"unindentified_rate": 6.25,
"execution_time": 0.0503
"execution_time": 0.0525
},
"48": {
"success_rate": 73.4063,
"error_rate": 20.3438,
"success_rate": 73.375,
"error_rate": 20.375,
"unindentified_rate": 6.25,
"execution_time": 0.0612
"execution_time": 0.0644
},
"64": {
"success_rate": 75.9063,
"error_rate": 17.875,
"unindentified_rate": 6.2188,
"execution_time": 0.0755
"execution_time": 0.078
},
"128": {
"success_rate": 82.4688,
"error_rate": 11.3438,
"success_rate": 82.5625,
"error_rate": 11.25,
"unindentified_rate": 6.1875,
"execution_time": 0.1183
"execution_time": 0.1275
},
"256": {
"success_rate": 85.1563,
"error_rate": 8.6875,
"unindentified_rate": 6.1563,
"execution_time": 0.2252
"execution_time": 0.2363
},
"512": {
"success_rate": 86.5625,
"error_rate": 7.4063,
"success_rate": 86.5313,
"error_rate": 7.4375,
"unindentified_rate": 6.0313,
"execution_time": 0.4095
"execution_time": 0.4234
},
"1024": {
"success_rate": 86.9841,
"error_rate": 7.0159,
"unindentified_rate": 6,
"execution_time": 0.738
"success_rate": 87.0006,
"error_rate": 7.007,
"unindentified_rate": 5.9924,
"execution_time": 0.7489
}
},
"stats": {
"min": 0.01,
"max": 99.93,
"success_rate": 70.1739,
"error_rate": 23.3584,
"unindentified_rate": 6.4677,
"execution_time": 0.0681
"success_rate": 70.193,
"error_rate": 23.3432,
"unindentified_rate": 6.4639,
"execution_time": 0.0668
},
"languages": {
"jpn": 99.93,
"kor": 99.8261,
"kor": 99.83,
"cmn": 99.35,
"deu": 94.18,
"ara": 91.89,
"fra": 87.32,
"nld": 87.21,
"eng": 81.38,
"eng": 81.39,
"por": 76.8,
"ita": 74.31,
"hin": 68.22,
"spa": 67.38,
"hin": 68.25,
"spa": 67.37,
"tur": 58.11,
"rus": 54.59,
"rus": 54.58,
"fin": 0.01,
"heb": 0.01
}
Expand Down
Loading

0 comments on commit 793f87f

Please sign in to comment.