@types/langdetect
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

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.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @types/langdetect

      Weekly Downloads

      4,545

      Version

      0.2.2

      License

      MIT

      Unpacked Size

      3.9 kB

      Total Files

      5

      Last publish

      Collaborators

      • types