-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33a3259
commit 6dee268
Showing
9 changed files
with
126 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { learn, compress } from 'suffix-thumb/builds/suffix-thumb.mjs' | ||
// import pairs from '/Users/spencer/mountain/suffix-thumb/test/data/fr-words.js' //0.3kb | ||
// import pairs from '/Users/spencer/mountain/suffix-thumb/test/data/fr-nous.js' //4.5kb | ||
// import pairs from '/Users/spencer/mountain/suffix-thumb/test/data/future-simple.js' //1.6kb | ||
import pairs from '/Users/spencer/mountain/compromise/data/pairs/Gerund.js'//5kb, 5s | ||
|
||
// import pairList from '/Users/spencer/mountain/fr-compromise/data/models/adjective/index.js' //1.7kb, 7 seconds | ||
// let pairs = Object.keys(pairList).map(k => [k, pairList[k][0]]) | ||
|
||
import filesize from './filesize.js' | ||
|
||
let begin = new Date() | ||
let model = learn(pairs) | ||
console.log(model) | ||
let pkd = compress(model) | ||
console.log(pkd) | ||
let end = new Date() | ||
console.log((end.getTime() - begin.getTime()) / 1000, 'seconds') | ||
console.log(filesize(pkd)) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import filesize from './filesize.js' | ||
import { compress } from '../src/index.js' | ||
|
||
const green = str => '\x1b[32m' + str + '\x1b[0m' | ||
const red = str => '\x1b[31m' + str + '\x1b[0m' | ||
const blue = str => '\x1b[34m' + str + '\x1b[0m' | ||
const magenta = str => '\x1b[35m' + str + '\x1b[0m' | ||
const cyan = str => '\x1b[36m' + str + '\x1b[0m' | ||
const yellow = str => '\x1b[33m' + str + '\x1b[0m' | ||
const black = str => '\x1b[30m' + str + '\x1b[0m' | ||
const dim = str => '\x1b[2m' + str + '\x1b[0m' | ||
|
||
const inspect = function (model) { | ||
console.log(green(Object.keys(model.fwd).length), 'fwd', magenta(Object.keys(model.both).length), 'both', magenta(Object.keys(model.rev).length), 'rev') | ||
console.log(' ', cyan(Object.keys(model.ex).length), 'ex') | ||
let pkd = compress(model) | ||
console.log(blue(filesize(pkd) + ' total')) | ||
console.log('\n\n') | ||
} | ||
export default inspect |