File size: 485 Bytes
814c07e
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
// Minimal ambient type declarations for the sentencepiece-js package.
// The package ships no .d.ts files; this declaration satisfies tsc's type-checking.
declare module 'sentencepiece-js' {
  export class SentencePieceProcessor {
    load(url: string): Promise<void>;
    loadVocabulary(url: string): void;
    encodeIds(text: string): number[];
    encodePieces(text: string): string[];
    decodeIds(ids: number[]): string;
  }
  export function cleanText(text: string): string;
}