UNPKG

lao-word-splitter

Version:

A utility to split Lao language sentences into individual words

35 lines (34 loc) 1.32 kB
"use strict"; /** * Main entry point for the Lao Word Splitter library. * This file exports the main function for splitting Lao text into words. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.splitLao = splitLao; // Import the LaoWordSplitter class const LaoWordSplitter_1 = require("./LaoWordSplitter"); // Create a singleton instance of LaoWordSplitter const splitter = new LaoWordSplitter_1.LaoWordSplitter(); /** * Splits a Lao language sentence into individual words. * This is the main function that users of the library will interact with. * * @param sentence - The Lao text to be split into words * @returns An array of words extracted from the input sentence * * @example * ```typescript * // Basic usage * const words = splitLao("ສະບາຍດີ"); // Returns ["ສະ", "ບາຍ", "ດີ"] * * // Handling complex cases * const complexWords = splitLao("ປະເທດລາວເປັນສິ່ງສວຍງາມ"); * // Returns ["ປະ", "ເທດ", "ລາວ", "ເປັນ", "ສິ່ງ", "ສວຍ", "ງາມ"] * * // Handling mixed content * const mixedWords = splitLao("ພາສາລາວ 101"); // Returns ["ພາ", "ສາ", "ລາວ", "101"] * ``` */ function splitLao(sentence) { return splitter.split(sentence); }