Baseline: main branch state prior to Top-10 films expansion
This commit is contained in:
commit
6b15603e56
139 files changed
+329420
No files matched your search
+66
@@ -0,0 +1,66 @@
|
||||
import { OutputFormat, TranslatedToken } from '@ingglish/phonemes';
|
||||
|
||||
interface IpaDict {
|
||||
entries: Record<string, string>;
|
||||
lang: string;
|
||||
}
|
||||
interface Language {
|
||||
code: string;
|
||||
label: string;
|
||||
}
|
||||
/** Insert spaces between adjacent Khmer words that have no separator. */
|
||||
declare function segmentKhmerText(text: string): string;
|
||||
declare const LANGUAGES: Language[];
|
||||
/**
|
||||
* Converts an IPA transcription to Ingglish spelling.
|
||||
* Strips slashes and syllable dots before conversion.
|
||||
*/
|
||||
declare function ipaToIngglish(ipa: string): string;
|
||||
declare function lookupIpa(dict: IpaDict, word: string): string | undefined;
|
||||
/** Marker for words not found in the dictionary */
|
||||
declare const NOT_FOUND_MARKER = "\uFFFD";
|
||||
/**
|
||||
* Translates foreign text to the specified output format.
|
||||
* Words not found in the dictionary are returned with a marker prefix.
|
||||
*
|
||||
* For caseless scripts (Arabic, Japanese, Chinese, Korean), sentence-initial
|
||||
* words are automatically capitalized in the output.
|
||||
*/
|
||||
declare function translateForeign(text: string, dict: IpaDict, format?: OutputFormat): string;
|
||||
/**
|
||||
* Like {@link translateForeign}, but returns token-by-token mappings instead of a string.
|
||||
* Each token includes the original text, translation, and whether it matched the dictionary.
|
||||
*/
|
||||
declare function translateForeignWithMapping(text: string, dict: IpaDict, format?: OutputFormat): TranslatedToken[];
|
||||
|
||||
/**
|
||||
* Converts IPA text to ARPAbet with stress digits stripped.
|
||||
*/
|
||||
declare function ipaToArpabetClean(ipa: string): null | string[];
|
||||
|
||||
/**
|
||||
* ARPAbet to IPA conversion.
|
||||
*
|
||||
* Converts CMU dictionary phoneme sequences to IPA notation,
|
||||
* with proper stress marker placement at syllable boundaries.
|
||||
*/
|
||||
/**
|
||||
* Converts a single ARPAbet phoneme to IPA.
|
||||
* Handles stress markers on vowels.
|
||||
*
|
||||
* @param phoneme ARPAbet phoneme (e.g., "AH0", "EY1", "B")
|
||||
* @returns IPA symbol (e.g., "ə", "ˈeɪ", "b")
|
||||
*/
|
||||
declare function arpabetPhonemeToIPA(phoneme: string): string;
|
||||
/**
|
||||
* Converts ARPAbet to IPA without surrounding slashes.
|
||||
* Useful for combining with other text.
|
||||
*
|
||||
* @param arpabet Array of ARPAbet symbols
|
||||
* @returns IPA transcription without surrounding slashes
|
||||
*/
|
||||
declare function arpabetToIPARaw(arpabet: string[]): string;
|
||||
|
||||
declare function registerIPA(): void;
|
||||
|
||||
export { type IpaDict, LANGUAGES, type Language, NOT_FOUND_MARKER, arpabetPhonemeToIPA, arpabetToIPARaw, ipaToArpabetClean, ipaToIngglish, lookupIpa, registerIPA, segmentKhmerText, translateForeign, translateForeignWithMapping };
|
||||
Reference in new issue
Block a user