Skip to content

Commit

Permalink
Merge pull request #812 from ihorskyi/fix_match_options
Browse files Browse the repository at this point in the history
Fix typings for match options to be optional
  • Loading branch information
spencermountain authored Feb 7, 2021
2 parents 33683ce + 535a50d commit da8958f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare interface DocIndex<
declare interface nlp<D extends object, W extends object, Ph extends Object> {
/** normal usage */
(text?: string, lexicon?: Lexicon): nlp.ExtendedDocument<D, W, Ph>
/** tozenize string */
/** tokenize string */
tokenize(text: string, lexicon?: Lexicon): nlp.ExtendedDocument<D, W, Ph>
/** mix in a compromise-plugin */
extend<P>(
Expand Down Expand Up @@ -197,27 +197,27 @@ declare module nlp {

// Match
/** return matching patterns in this doc */
match(match: string | ExtendedDocument<Ext, W, Ph>, options:any): ExtendedDocument<Ext, W, Ph>
match(match: string | ExtendedDocument<Ext, W, Ph>, options?:any): ExtendedDocument<Ext, W, Ph>
/** return a named group in a match */
match(match: string | ExtendedDocument<Ext, W, Ph>, group:string|number): ExtendedDocument<Ext, W, Ph>
/** return all results except for this */
not(match: string | ExtendedDocument<Ext, W, Ph>, options:any): ExtendedDocument<Ext, W, Ph>
not(match: string | ExtendedDocument<Ext, W, Ph>, options?:any): ExtendedDocument<Ext, W, Ph>
/** return only the first match */
matchOne(match: string | ExtendedDocument<Ext, W, Ph>, options:any): ExtendedDocument<Ext, W, Ph>
matchOne(match: string | ExtendedDocument<Ext, W, Ph>, options?:any): ExtendedDocument<Ext, W, Ph>
/** return each current phrase, only if it contains this match */
if(match: string | ExtendedDocument<Ext, W, Ph>, options:any): ExtendedDocument<Ext, W, Ph>
if(match: string | ExtendedDocument<Ext, W, Ph>, options?:any): ExtendedDocument<Ext, W, Ph>
/** Filter-out any current phrases that have this match */
ifNo(match: string | ExtendedDocument<Ext, W, Ph>, options:any): ExtendedDocument<Ext, W, Ph>
ifNo(match: string | ExtendedDocument<Ext, W, Ph>, options?:any): ExtendedDocument<Ext, W, Ph>
/** Return a boolean if this match exists */
has(match: string | ExtendedDocument<Ext, W, Ph>, options:any): boolean
has(match: string | ExtendedDocument<Ext, W, Ph>, options?:any): boolean
/** search through earlier terms, in the sentence */
lookBehind(match: string | ExtendedDocument<Ext, W, Ph>, options:any): ExtendedDocument<Ext, W, Ph>
lookBehind(match: string | ExtendedDocument<Ext, W, Ph>, options?:any): ExtendedDocument<Ext, W, Ph>
/** search through following terms, in the sentence */
lookAhead(match: string | ExtendedDocument<Ext, W, Ph>, options:any): ExtendedDocument<Ext, W, Ph>
lookAhead(match: string | ExtendedDocument<Ext, W, Ph>, options?:any): ExtendedDocument<Ext, W, Ph>
/** return the terms before each match */
before(match: string | ExtendedDocument<Ext, W, Ph>, options:any): ExtendedDocument<Ext, W, Ph>
before(match: string | ExtendedDocument<Ext, W, Ph>, options?:any): ExtendedDocument<Ext, W, Ph>
/** return the terms after each match */
after(match: string | ExtendedDocument<Ext, W, Ph>, options:any): ExtendedDocument<Ext, W, Ph>
after(match: string | ExtendedDocument<Ext, W, Ph>, options?:any): ExtendedDocument<Ext, W, Ph>
/** quick find for an array of string matches */
lookup(matches: string[]): ExtendedDocument<Ext, W, Ph>
/** quick find for an object of key-value matches */
Expand Down Expand Up @@ -344,7 +344,7 @@ declare module nlp {
emails(n?: number): ExtendedDocument<Ext, W, Ph>
/** return things like `:)` */
emoticons(n?: number): ExtendedDocument<Ext, W, Ph>
/** return athings like `💋` */
/** return things like `💋` */
emoji(n?: number): ExtendedDocument<Ext, W, Ph>
/** return things like `'@nlp_compromise'`*/
atMentions(n?: number): ExtendedDocument<Ext, W, Ph>
Expand Down Expand Up @@ -659,7 +659,7 @@ declare module nlp {
/** a dash separates words - like that */
hasDash(): boolean

/** is it multiple words combinded */
/** is it multiple words combined */
hasContraction(): boolean

/** try to sensibly put this punctuation mark into the term */
Expand Down

0 comments on commit da8958f

Please sign in to comment.