Skip to content

Capturing user input as a custom entity? #77

Discussion options

You must be logged in to vote

Hello @timtutt

The pattern [|ADJ|ADP|ADV|ADV|AUX|CCONJ|DET|INTJ|NOUN|NUM|PART|PRON|PROPN|PUNCT|SCONJ|SYM|VERB|X] will detect a single token of any PoS and not multiple instances. Currently winkNLP does not support wildcard match. Therefore one way to achieve is to use the following pattern, provided you are only looking to capture only upto a few tokens — say 3 or 4:

const winkNLP = require( 'wink-nlp' );
const model = require( 'wink-eng-lite-web-model' );
const nlp = winkNLP( model );
const its = nlp.its;

const ANY = ' [|ADJ|ADP|ADV|ADV|AUX|CCONJ|DET|INTJ|NOUN|NUM|PART|PRON|PROPN|PUNCT|SCONJ|SYM|VERB|X]';
const patterns = [
  {
    name: 'multi-word-capture',
    patterns: [
    '[where…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@timtutt
Comment options

@sanjayaksaxena
Comment options

Answer selected by timtutt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants