mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-24 00:27:40 +00:00
Test the ASCII word breaker.
This commit is contained in:
parent
b2282c0349
commit
ed9e95f9a7
1 changed files with 13 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
var assert = require('chai').assert;
|
||||
var sinon = require('sinon');
|
||||
|
||||
let LMLayer = require('../../build');
|
||||
var breakASCIIWords = require('../../build/intermediate').wordBreakers['ascii'];
|
||||
|
||||
describe('The ASCIIWordBreaker', function() {
|
||||
it('breaks simple English sentences', function () {
|
||||
let breaks = breakASCIIWords('Look! -- The quick brown fox jumps... over the lazy dog!');
|
||||
let words = breaks.map(span => span.text);
|
||||
assert.deepEqual(words, ['Look', 'the', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog']);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue