UNPKG

phonemize

Version:

Fast phonemizer with rule-based G2P prediction. Pure JavaScript implementation.

31 lines (30 loc) 878 B
export interface POSResult { word: string; pos: string; confidence: number; } export declare class SimplePOSTagger { private static readonly VERB_ENDINGS; private static readonly NOUN_ENDINGS; private static readonly ADJECTIVE_ENDINGS; private static readonly DETERMINERS; private static readonly AUX_VERBS; private static readonly PREPOSITIONS; /** * Check if a word is likely a noun based on its endings */ private isLikelyNoun; /** * Tag a single word with its most likely POS */ tagWord(word: string, context?: string[]): POSResult; /** * Tag multiple words in sequence with context */ tagWords(words: string[]): POSResult[]; /** * Simple sentence-level POS tagging */ tagSentence(text: string): POSResult[]; } export declare const simplePOSTagger: SimplePOSTagger;