ngram
Description
Example: Bigrams
import {of} from 'rxjs';
import {take} from 'rxjs/operators';
import {ngram} from '@bottlenose/rxnlp';
const words = ['yo', 'ho', 'yo', 'ho', 'a', 'pirate\'s', 'life'];
const word$ = of(...words);
const bigram$ = word$.pipe(
ngram(),
take(3)
);
bigram$.subscribe(console.log);
// ['yo', 'ho']
// ['ho', 'yo']
// ['yo', 'ho']Example: Trigrams
Example: Unique Bigrams
API
Since
Parameters
Options
Returns
Arguments
Options
Last updated