kstafford3 / posibly

Compare and convert part-of-speech tagged sentences to an expected grammar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Posibly

Compare and Convert Part-of-Speech Tagged Sentences to Expected Grammar.

npm version Build Status

Install

npm install --save posibly

Initialize

const Posibly = require('posibly');
const posibly = new Posibly(['V', 'DT', 'N']);

Compare

// using posibly from above
const tagged = [ [ 'eat', 'V' ], [ 'food', 'N' ] ];
const editPath = posibly.editPath(tagged);
// editPath.distance = 1

Convert

// using editPath from above
const retagged = editPath.retag();
/*
  retagged = [
    [ 'eat', 'V' ],
    [ null, 'DT' ],
    [ 'food', 'N' ],
  ]
*/

Copyright 2017, Kyle Stafford (MIT License).

About

Compare and convert part-of-speech tagged sentences to an expected grammar.

License:MIT License


Languages

Language:JavaScript 100.0%