Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

wordmap-lexer

A lexer used in wordMAP

readme

Build Status codecov TypeScript

wordMAP-lexer

A lexical tool for wordMAP

The lexer provides tools generating tokens which can be fed into WordMAP.

Install

npm i wordmap-lexer

Usage


require Lexer, {Token} from 'wordmap-lexer';

const tokens : Token[] = Lexer.tokenize("hello, world");
// produces tokens "hello" and "world".

const puct_tokens : Token[] = Lexer.tokenize("hello, world", {punctuation: true});
// produces tokens "hello", ",", and "world".