wn-ts-node
Version:
Wordnet interface library - TypeScript port
119 lines • 5.15 kB
TypeScript
import { Word, Sense, Synset, Lexicon, PartOfSpeech, WordnetOptions, ILI, WordQuery, SynsetQuery, SenseQuery, WordNetCore, Definition } from 'wn-ts-core';
export declare class Wordnet implements WordNetCore {
private kyselyWordnet;
private expand;
private defaultNormalizer;
private defaultLemmatizer;
private initialized;
constructor(lexicon?: string, options?: WordnetOptions);
/**
* Initialize the database if not already initialized
*/
private ensureInitialized;
/**
* Close the database connection
*/
close(): Promise<void>;
/**
* Create a default normalizer function
*/
private createDefaultNormalizer;
/**
* Create a default lemmatizer function
*/
private createDefaultLemmatizer;
lexicons(): Promise<Lexicon[]>;
query(_sql: string, _params?: unknown[]): Promise<unknown[]>;
/**
* Get synsets with various query options
*/
synsets(query?: SynsetQuery): Promise<Synset[]>;
synsets(form: string, pos?: PartOfSpeech, options?: {
lexicon?: string | string[];
}): Promise<Synset[]>;
/**
* Get senses with various query options
*/
senses(query?: SenseQuery): Promise<Sense[]>;
senses(form: string, pos?: PartOfSpeech, options?: {
lexicon?: string | string[];
}): Promise<Sense[]>;
/**
* Get words with various query options
*/
words(query?: WordQuery): Promise<Word[]>;
words(form: string, pos?: PartOfSpeech, options?: {
lexicon?: string | string[];
}): Promise<Word[]>;
getWord(form: string): Promise<Word[]>;
getSynset(id: string): Promise<Synset | null>;
/**
* Alias for getSynset for consistency with other methods
*/
getSynsetById(id: string): Promise<Synset | null>;
getSenses(form: string, pos?: PartOfSpeech, options?: {
lexicon?: string | string[];
}): Promise<Sense[]>;
getRelations(_synsetId: string, _relationType?: string): Promise<any[]>;
getSense(id: string): Promise<Sense | undefined>;
getIli(id: string): Promise<ILI | undefined>;
getWordOrUndefined(id: string): Promise<Word | undefined>;
getSynsetOrUndefined(id: string): Promise<Synset | undefined>;
getSenseOrUndefined(id: string): Promise<Sense | undefined>;
getStatistics(): Promise<{
totalWords: number;
totalSynsets: number;
totalSenses: number;
totalILIs: number;
totalLexicons: number;
}>;
expandedLexicons(): Promise<Lexicon[]>;
normalizeForm(form: string): Promise<string>;
morphy(form: string, pos?: PartOfSpeech): Promise<Record<PartOfSpeech, Set<string>>>;
ilis(status?: string): Promise<ILI[]>;
word(wordId: string): Promise<Word>;
synset(synsetId: string): Promise<Synset>;
sense(senseId: string): Promise<Sense>;
ili(iliId: string): Promise<ILI>;
synsetsByILI(iliId: string): Promise<Synset[]>;
getProjects(): Promise<any[]>;
searchWords(query: any): Promise<Word[]>;
searchSynsets(query: any): Promise<Synset[]>;
wordsByForm(form: string, options?: any): Promise<Word[]>;
synsetsByForm(form: string, options?: any): Promise<Synset[]>;
getWordForms(wordId: string): Promise<string[]>;
getWordLemma(wordId: string): Promise<string>;
getDerivedWords(wordId: string): Promise<Word[]>;
getHypernyms(synsetId: string): Promise<Synset[]>;
getHyponyms(synsetId: string): Promise<Synset[]>;
getRelatedSynsets(synsetId: string, relationType: string): Promise<Synset[]>;
getRelatedSenses(senseId: string, relationType: string): Promise<Sense[]>;
getShortestPath(synsetId1: string, synsetId2: string): Promise<Synset[]>;
getSynsetDepth(synsetId: string): Promise<number>;
translateWord(wordId: string, targetLang: string): Promise<Record<string, Word[]>>;
translateSynset(synsetId: string, targetLang: string): Promise<Synset[]>;
translateSense(senseId: string, targetLang: string): Promise<Sense[]>;
getCrossLingualSynsets(iliId: string, targetLangs?: string[]): Promise<Record<string, Synset[]>>;
getDefinitions(synsetId: string): Promise<Definition[]>;
getExamples(synsetId: string): Promise<string[]>;
getSenseExamples(senseId: string): Promise<string[]>;
getSynsetWords(synsetId: string): Promise<Word[]>;
getSynsetLemmas(synsetId: string): Promise<string[]>;
getSynsetSenses(synsetId: string): Promise<Sense[]>;
hasLexicon(lexiconId: string): Promise<boolean>;
getSupportedLanguages(): Promise<string[]>;
getLexiconDependencies(lexiconId: string): Promise<string[]>;
/**
* Get words by ILI and language
*/
getWordsByIliAndLanguage(ili: string, language?: string): Promise<Word[]>;
getLexiconStatistics(lexiconId?: string): Promise<any[]>;
getDataQualityMetrics(): Promise<any>;
getPartOfSpeechDistribution(): Promise<Record<string, number>>;
getSynsetSizeAnalysis(): Promise<any>;
/**
* Get the query service for direct database operations
*/
getQueryService(): Promise<import('./index.js').KyselyQueryService>;
}
//# sourceMappingURL=wordnet.d.ts.map