Installation
npm install --save @types/langdetect
Summary
This package contains type definitions for langdetect (https://github.com/newmsz/node-language-detection).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/langdetect.
index.d.ts
export interface LanguageDetectionResult {
lang: string;
prob: number;
}
/**
* Detects the language of the input text and returns an array of possible language detections
* along with their probabilities.
* @param text The input text for language detection.
* @returns An array of language detection results.
*/
export function detect(text: string): LanguageDetectionResult[];
/**
* Detects the most probable language of the input text and returns the ISO 639-1 language code.
* @param text The input text for language detection.
* @returns The ISO 639-1 language code of the most probable language.
*/
export function detectOne(text: string): string;
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:38 GMT
- Dependencies: none
Credits
These definitions were written by SaidTorres3.