2.0.0 • Published 2 years ago

fast-tag-pos v2.0.0

Weekly downloads
-
License
LGPL-3.0
Repository
github
Last release
2 years ago

POS build & test npm license min minzip

pos-js is a Javascript port of Mark Watson's FastTag Part of Speech Tagger which was itself based on Eric Brill's trained rule set and English lexicon. It also includes a basic lexer that can be used to extract words and other tokens from text strings. Originally this was written by Percy Wegmann and is available on Google code.

This fork adds TypeScript support to a fork made by Darius Kazemi which added Node.JS and npm support.

Demo

Click here to check demo or checkout samples and demo source.

Installation

npm install @devil7softwares/pos

(or)

yarn add @devil7softwares/pos

Usage

import { Lexer, Tagger, TagType } from '@devil7softwares/pos';

const lexer = new Lexer();
const tagger = new Tagger();

const words = lexer.lex('This is some sample text. This text can contain multiple sentences.');
const taggedWords = tagger.tag(words);

for (const [word, tag] of taggedWords) {
    console.log(word + ' /' + tag);
}

License

jspos is licensed under the GNU LGPLv3

Acknowledgements

Thanks to Mark Watson for writing FastTag, which served as the basis for jspos.

Tags

TagDescriptionExample
CCCoord Conjuncnand,but,or
CDCardinal numberone,two
DTDeterminerthe,some
EXExistential therethere
FWForeign Wordmon dieu
INPrepositionof,in,by
JJAdjectivebig
JJRAdj., comparativebigger
JJSAdj., superlativebiggest
LSList item marker1,One
MDModalcan,should
NNNoun, sing. or massdog
NNPProper noun, sing.Edinburgh
NNPSProper noun, pluralSmiths
NNSNoun, pluraldogs
POSPossessive ending's
PDTPredeterminerall, both
PRP$Possessive pronounmy,one's
PRPPersonal pronounI,you,she
RBAdverbquickly
RBRAdverb, comparativefaster
RBSAdverb, superlativefastest
RPParticleup,off
SYMSymbol+,%,&
TO'to'to
UHInterjectionoh, oops
VBverb, base formeat
VBDverb, past tenseate
VBGverb, gerundeating
VBNverb, past parteaten
VBPVerb, presenteat
VBZVerb, presenteats
WDTWh-determinerwhich,that
WPWh pronounwho,what
WP$Possessive-Whwhose
WRBWh-adverbhow,where
,Comma,
.Sent-final punct. ! ?
:Mid-sent punct.: ; Ñ
$Dollar sign$
#Pound sign#
"quote"
(Left paren(
)Right paren)

See TagTypes.ts