@botonic/plugin-contentful
Version:
Botonic Plugin Contentful is one of the **[available](https://github.com/hubtype/botonic/tree/master/packages)** plugins for Botonic. **[Contentful](http://www.contentful.com)** is a CMS (Content Management System) which manages contents of a great variet
35 lines (34 loc) • 1.24 kB
TypeScript
import { ValueObject } from '../util';
import { Locale } from './locales';
import { Normalizer } from './normalizer';
export declare class TokenRange implements ValueObject {
readonly from: number;
readonly to: number;
constructor(from: number, to: number);
equals(other: TokenRange): boolean;
toString(): string;
}
/**
* Remove a substring if it matches from a list of provided strings, and it
* occurs at the specified position (start or end).
* It removes all separators between the stripped and the remaining parts.
* It preprocesses the strings (separators, capitals, accents) but apart
* from that the tokens must be identical
*/
export declare class TokenStripper {
readonly locale: Locale;
readonly normalizer: Normalizer;
static START_POSITION: number;
static END_POSITION: number;
needleTokensByPos: {
[position: number]: string[][];
};
constructor(needlesByPos: {
[position: number]: string[];
}, locale: Locale, normalizer?: Normalizer);
/**
* tokens do not to previously remove stopwords which may occur in needles
*/
search(tokens: string[], pos: number): TokenRange | undefined;
strip(haystack: string, pos: number): string;
}