Sfoglia il codice sorgente

Merge pull request #2310 from visuddhinanda/development

Development
visuddhinanda 9 mesi fa
parent
commit
50316bf5b3

+ 1 - 1
api-v8/app/Console/Commands/CreateMyHanCrop.php

@@ -86,7 +86,7 @@ class CreateMyHanCrop extends Command
             foreach ($words as $key => $value) {
                 $wordWithIndex[] = [
                     'index' => $key + 1,
-                    'word' => $value,
+                    'word' => trim($value),
                 ];
             }
             $data = [

+ 70 - 69
api-v8/app/Console/Commands/InitCs6sentence.php

@@ -43,79 +43,78 @@ class InitCs6sentence extends Command
      */
     public function handle()
     {
-        if(\App\Tools\Tools::isStop()){
+        if (\App\Tools\Tools::isStop()) {
             return 0;
         }
-		$start = time();
+        $start = time();
         $channelId = ChannelApi::getSysChannel('_System_Pali_VRI_');
-        if($channelId === false){
+        if ($channelId === false) {
             $this->error('no channel');
             return 1;
         }
         $this->info($channelId);
-		$pali = new PaliSentence;
-		if(!empty($this->argument('book'))){
-			$pali = $pali->where('book',$this->argument('book'));
-		}
-		if(!empty($this->argument('para'))){
-			$pali = $pali->where('paragraph',$this->argument('para'));
-		}
-		$bar = $this->output->createProgressBar($pali->count());
-		$pali = $pali->select('book','paragraph','word_begin','word_end')->cursor();
-        $pageHead = ['M','P','T','V','O'];
-		foreach ($pali as $value) {
-			# code...
-			$words = WbwTemplate::where("book",$value->book)
-								->where("paragraph",$value->paragraph)
-								->where("wid",">=",$value->word_begin)
-								->where("wid","<=",$value->word_end)
-								->orderBy('wid','asc')
-								->get();
-			$sent = '';
-			$boldStart = false;
-			$boldCount = 0;
+        $pali = new PaliSentence;
+        if (!empty($this->argument('book'))) {
+            $pali = $pali->where('book', $this->argument('book'));
+        }
+        if (!empty($this->argument('para'))) {
+            $pali = $pali->where('paragraph', $this->argument('para'));
+        }
+        $bar = $this->output->createProgressBar($pali->count());
+        $pali = $pali->select('book', 'paragraph', 'word_begin', 'word_end')->cursor();
+        $pageHead = ['M', 'P', 'T', 'V', 'O'];
+        foreach ($pali as $value) {
+            # code...
+            $words = WbwTemplate::where("book", $value->book)
+                ->where("paragraph", $value->paragraph)
+                ->where("wid", ">=", $value->word_begin)
+                ->where("wid", "<=", $value->word_end)
+                ->orderBy('wid', 'asc')
+                ->get();
+            $sent = '';
+            $boldStart = false;
+            $boldCount = 0;
             $lastWord = null;
-			foreach ($words as $word) {
-				# code...
-				//if($word->style != "note" && $word->type != '.ctl.')
-				if( $word->type != '.ctl.'){
-                    if($lastWord !== null){
-                        if($word->real !== "ti" ){
+            foreach ($words as $word) {
+                # code...
+                //if($word->style != "note" && $word->type != '.ctl.')
+                if ($word->type != '.ctl.') {
+                    if ($lastWord !== null) {
+                        if ($word->real !== "ti") {
 
-                            if(!(empty($word->real) && empty($lastWord->real))) {
-                                    #如果不是标点符号,在词的前面加空格 。
+                            if (!(empty($word->real) && empty($lastWord->real))) {
+                                #如果不是标点符号,在词的前面加空格 。
                                 $sent .= " ";
                             }
                         }
                     }
 
-					if(strpos($word->word,'{') !== false ){
+                    if (strpos($word->word, '{') !== false) {
                         //一个单词里面含有黑体字的
-						$paliWord = \str_replace("{","<strong>",$word->word) ;
-						$paliWord = \str_replace("}","</strong>",$paliWord) ;
+                        $paliWord = \str_replace("{", "<strong>", $word->word);
+                        $paliWord = \str_replace("}", "</strong>", $paliWord);
                         $sent .= $paliWord;
-					}else{
-                        if($word->style=='bld'){
+                    } else {
+                        if ($word->style == 'bld') {
                             $sent .= "<strong>{$word->word}</strong>";
-                        }else{
+                        } else {
                             $sent .= $word->word;
                         }
-					}
-
-				}else{
-                    $type = substr($word->word,0,1);
-                    if(in_array($type,$pageHead)){
-                        $arrPage = explode('.',$word->word);
-                        if(count($arrPage)===2){
-                            $pageNumber = $arrPage[0].'.'.(int)$arrPage[1];
-                           $sent .= "<code>{$pageNumber}</code>";
+                    }
+                } else {
+                    $type = substr($word->word, 0, 1);
+                    if (in_array($type, $pageHead)) {
+                        $arrPage = explode('.', $word->word);
+                        if (count($arrPage) === 2) {
+                            $pageNumber = $arrPage[0] . '.' . (int)$arrPage[1];
+                            $sent .= "<code>{$pageNumber}</code>";
                         }
                     }
                 }
                 $lastWord = $word;
-			}
+            }
 
-			#将wikipali风格的引用 改为缅文风格
+            #将wikipali风格的引用 改为缅文风格
             /*
 			$sent = \str_replace('n’’’ ti','’’’nti',$sent);
 			$sent = \str_replace('n’’ ti','’’nti',$sent);
@@ -123,33 +122,35 @@ class InitCs6sentence extends Command
 			$sent = \str_replace('**ti**','**ti',$sent);
 			$sent = \str_replace('‘ ','‘',$sent);
             */
-			$newRow = Sentence::firstOrNew(
-				[
-					"book_id" => $value->book,
-					"paragraph" => $value->paragraph,
-					"word_start" => $value->word_begin,
-					"word_end" => $value->word_end,
-					"channel_uid" => $channelId,
-				],
-				[
-					'id' =>app('snowflake')->id(),
-					'uid' =>Str::uuid(),
-                    'create_time' => time()*1000,
-				]
-				);
+            $sent = \str_replace(' ti', 'ti', $sent);
+
+            $newRow = Sentence::firstOrNew(
+                [
+                    "book_id" => $value->book,
+                    "paragraph" => $value->paragraph,
+                    "word_start" => $value->word_begin,
+                    "word_end" => $value->word_end,
+                    "channel_uid" => $channelId,
+                ],
+                [
+                    'id' => app('snowflake')->id(),
+                    'uid' => Str::uuid(),
+                    'create_time' => time() * 1000,
+                ]
+            );
             $newRow->editor_uid = config("mint.admin.root_uuid");
             $newRow->content = "<span>{$sent}</span>";
-            $newRow->strlen = mb_strlen($sent,"UTF-8");
+            $newRow->strlen = mb_strlen($sent, "UTF-8");
             $newRow->status = 10;
             $newRow->content_type = "html";
-            $newRow->modify_time = time()*1000;
+            $newRow->modify_time = time() * 1000;
             $newRow->language = 'en';
             $newRow->save();
 
-			$bar->advance();
-		}
-		$bar->finish();
-		$this->info("finished ".(time()-$start)."s");
+            $bar->advance();
+        }
+        $bar->finish();
+        $this->info("finished " . (time() - $start) . "s");
         return 0;
     }
 }

+ 11 - 7
api-v8/app/Console/Commands/TestAiTask.php

@@ -3,8 +3,8 @@
 namespace App\Console\Commands;
 
 use Illuminate\Console\Command;
-use App\Http\Api\AiTaskPrepare;
-use App\Services\AiTranslateService;
+use App\Models\TaskAssignee;
+use App\Models\AiModel;
 
 class TestAiTask extends Command
 {
@@ -41,11 +41,15 @@ class TestAiTask extends Command
     public function handle()
     {
         $taskId = $this->argument('id');
-        $ai = app(AiTranslateService::class);
-        $params = $ai->makeByTask($taskId, !$this->option('test'));
-        var_dump($params);
-        var_dump($this->option('test'));
-        $this->info('total:' . count($params));
+        $taskAssignee = TaskAssignee::where('task_id', $taskId)
+            ->select('assignee_id')->get();
+        $aiAssistant = AiModel::whereIn('uid', $taskAssignee)->first();
+        if ($aiAssistant) {
+            $count = \App\Jobs\ProcessAITranslateJob::publish($taskId, $aiAssistant->uid);
+            $this->info('publish total:' . $count);
+        } else {
+            $this->error('no ai assistant');
+        }
         return 0;
     }
 }

+ 1 - 0
api-v8/app/Jobs/ProcessAITranslateJob.php

@@ -54,5 +54,6 @@ class ProcessAITranslateJob extends BaseRabbitMQJob
             $queue = 'ai_translate_us';
         }
         $mq->publishMessage($queue, $data);
+        return count($data['payload']);
     }
 }

+ 9 - 9
api-v8/config/mint.php

@@ -78,15 +78,15 @@ return [
     */
     'path' => [
         'dependence' => storage_path('depandence'),
-        'palitext' => public_path('palihtml'),
-        'palitext_filelist' => public_path('palihtml') . '/filelist.csv',
-        'palicsv' => public_path('tmp') . '/palicsv',
-        'pali_title' => public_path('pali_title'),
-        'paliword' => public_path('paliword'),
-        'paliword_book' => public_path('paliword') . "/book",
-        'paliword_index' => public_path('paliword') . "/index",
-        'word_statistics' => public_path('dependence') . "/word_statistics/data",
-        'dict_text' => public_path('dicttext'),
+        'palitext' => storage_path('resources/pali_html'),
+        'palitext_filelist' => storage_path('resources/pali_html/filelist.csv'),
+        'palicsv' => storage_path('app/tmp/pali_csv'),
+        'pali_title' => storage_path('resources/pali_title'),
+        'paliword' => storage_path('resources/pali_word'),
+        'paliword_book' => storage_path('resources/pali_word/book'),
+        'paliword_index' => storage_path('resources/pali_word/index'),
+        'word_statistics' => storage_path('resources/word_statistics/data'),
+        'dict_text' => storage_path('resources/dict_text'),
     ],
 
     'admin' => [

+ 57 - 6
api-v8/resources/mustache/my_han_crop.tpl

@@ -31,12 +31,17 @@
             }
             .word {
                 width: 10vw;
+				display: contents;
             }
 
-            .word-img {
-                width: 45vw;
+            .word-img img{
+                width: 35vw;
+                margin: -5px;
             }
-
+			.result{
+				max-height: 200vw;
+			    overflow: scroll;
+			}
             /* 默认滚动条样式 */
             .img::-webkit-scrollbar {
                 width: 6px;
@@ -67,13 +72,58 @@
             .img::-webkit-scrollbar-thumb:hover {
                 background: #555;
             }
+            .result::-webkit-scrollbar {
+                width: 6px;
+                height: 6px;
+            }
+
+            .result::-webkit-scrollbar-track {
+                background: #f1f1f1;
+                border-radius: 6px;
+            }
+
+            .result:not(:hover)::-webkit-scrollbar-track {
+                background: transparent;
+            }
+
+            .result::-webkit-scrollbar-thumb {
+                background: #888;
+                border-radius: 6px;
+                transition: all 0.3s ease;
+            }
+
+            .result:not(:hover)::-webkit-scrollbar-thumb {
+                background: transparent;
+                border-radius: 6px;
+                transition: all 0.3s ease;
+            }
+
+            .result::-webkit-scrollbar-thumb:hover {
+                background: #555;
+            }
+            .copied {
+                color: #01955e;
+                display: none;
+                position: fixed;
+            }
         </style>
         <script>
-            function copy(text) {
+            function copy(text, index) {
                 navigator.clipboard.writeText(text).then(() => {
-                    alert(text + " 已经拷贝到剪贴板");
+                    show(index);
+                    setTimeout(() => {
+                        hide(index);
+                    }, 2000);
                 });
             }
+            function show(index) {
+                let el = document.getElementById("copied-" + index);
+                el.style.display = "inline-block";
+            }
+            function hide(index) {
+                let el = document.getElementById("copied-" + index);
+                el.style.display = "none";
+            }
         </script>
     </head>
     <body>
@@ -93,7 +143,8 @@
                         <td class="word">{{ index }}</td>
                         <td class="word">
                             {{ word }}
-                            <button onclick="copy('{{ word }}')">复制</button>
+                            <button onclick="copy('{{ word }}',{{ index }})">复制</button>
+                            <span class="copied" id="copied-{{ index }}">已经复制</span>
                         </td>
                         <td class="word-img">
                             <img src="img/{{ word }}.png" />

+ 1 - 1
dashboard-v4/dashboard/src/components/ai/AiModelLogList.tsx

@@ -1,5 +1,5 @@
 import { ProList } from "@ant-design/pro-components";
-import { Button, Space, Tabs, Tag, Typography } from "antd";
+import { Space, Tabs, Tag, Typography } from "antd";
 import type { Key } from "react";
 import { useState } from "react";
 

+ 31 - 13
dashboard-v4/dashboard/src/components/template/Nissaya/NissayaMeaning.tsx

@@ -1,8 +1,13 @@
 import { useEffect, useState } from "react";
+import { Tag, Tooltip, Typography } from "antd";
 import { useAppSelector } from "../../../hooks";
+
 import { getEnding } from "../../../reducers/nissaya-ending-vocabulary";
 import Lookup from "../../dict/Lookup";
 import { NissayaCardPop } from "../../general/NissayaCard";
+import { convertMyanmarPaliToRoman } from "../../../myanmar-pali-converter";
+
+const { Text } = Typography;
 
 export interface IMeaning {
   base: string;
@@ -46,12 +51,16 @@ const NissayaMeaningWidget = ({ text, code = "my" }: IWidget) => {
   const [words, setWords] = useState<IMeaning[]>();
   const endings = useAppSelector(getEnding);
 
+  const match = text?.match(/#(\d+)%/);
+  const cf = match ? parseInt(match[1]) : null;
+
   useEffect(() => {
     if (typeof text === "undefined" || typeof endings === "undefined") {
       return;
     }
 
-    const mWords: IMeaning[] = text.split(" ").map((item) => {
+    const _text = text.replace(/#\d+%/, "");
+    const mWords: IMeaning[] = _text.split(" ").map((item) => {
       return nissayaBase(item, endings);
     });
     setWords(mWords);
@@ -60,19 +69,28 @@ const NissayaMeaningWidget = ({ text, code = "my" }: IWidget) => {
   if (typeof text === "undefined") {
     return <></>;
   }
+
   return (
-    <span>
-      {words?.map((item, id) => {
-        return (
-          <span key={id}>
-            <Lookup search={item.base}>{item.base}</Lookup>
-            {item.ending?.map((item, id) => {
-              return <NissayaCardPop text={item} key={id} trigger={item} />;
-            })}{" "}
-          </span>
-        );
-      })}
-    </span>
+    <Text>
+      <>
+        {words?.map((item, id) => {
+          const result = convertMyanmarPaliToRoman(item.base);
+          return (
+            <span key={id}>
+              <Lookup search={item.base}>
+                <Tooltip title={result} mouseEnterDelay={2}>
+                  {item.base}
+                </Tooltip>
+              </Lookup>
+              {item.ending?.map((item, id) => {
+                return <NissayaCardPop text={item} key={id} trigger={item} />;
+              })}{" "}
+            </span>
+          );
+        })}
+      </>
+      <>{cf !== null && cf < 90 ? <Tag color="red">{cf}</Tag> : undefined}</>
+    </Text>
   );
 };
 

+ 339 - 0
dashboard-v4/dashboard/src/myanmar-pali-converter.ts

@@ -0,0 +1,339 @@
+/**
+ * 缅文巴利转罗马巴利转换器
+ * Myanmar Pali to Roman Pali Converter
+ */
+
+// 字符映射接口
+interface CharacterMapping {
+  [key: string]: string;
+}
+
+// 转换规则接口
+interface ConversionRule {
+  pattern: RegExp;
+  replace: string | ((match: string, ...args: string[]) => string);
+}
+
+// 缅文到罗马巴利文的字符映射表
+const MYANMAR_TO_ROMAN: CharacterMapping = {
+  // 基本辅音
+  က: "ka",
+  ခ: "kha",
+  ဂ: "ga",
+  ဃ: "gha",
+  င: "ṅa",
+  စ: "ca",
+  ဆ: "cha",
+  ဇ: "ja",
+  ဈ: "jha",
+  ဉ: "ña",
+  ည: "ña",
+  ဋ: "ṭa",
+  ဌ: "ṭha",
+  ဍ: "ḍa",
+  ဎ: "ḍha",
+  ဏ: "ṇa",
+  တ: "ta",
+  ထ: "tha",
+  ဒ: "da",
+  ဓ: "dha",
+  န: "na",
+  ပ: "pa",
+  ဖ: "pha",
+  ဗ: "ba",
+  ဘ: "bha",
+  မ: "ma",
+  ယ: "ya",
+  ရ: "ra",
+  လ: "la",
+  ဝ: "va",
+  သ: "sa",
+  ဟ: "ha",
+  ဠ: "ḷa",
+  အ: "a",
+
+  // 独立元音
+  ဣ: "i",
+  ဤ: "ī",
+  ဥ: "u",
+  ဦ: "ū",
+  ဧ: "e",
+  ဩ: "o",
+
+  // 元音符号
+  "ါ": "ā",
+  "ာ": "ā",
+  "ိ": "i",
+  "ီ": "ī",
+  "ု": "u",
+  "ူ": "ū",
+  "ေ": "e",
+  "ံ": "ṃ",
+  "့": "",
+  "်": "",
+
+  // 特殊符号
+  "္": "", // virama (halant)
+
+  // 数字
+  "၀": "0",
+  "၁": "1",
+  "၂": "2",
+  "၃": "3",
+  "၄": "4",
+  "၅": "5",
+  "၆": "6",
+  "၇": "7",
+  "၈": "8",
+  "၉": "9",
+
+  // 标点符号
+  "၊": ",",
+  "။": ".",
+  "၍": " ",
+  "၎": " ",
+};
+
+// 特殊转换规则
+const SPECIAL_CONVERSION_RULES: ConversionRule[] = [
+  // 元音组合
+  { pattern: /ေါ/g, replace: "o" },
+  { pattern: /ေါ်/g, replace: "au" },
+  { pattern: /ံ့/g, replace: "ṃ" },
+
+  // 双辅音组合处理
+  {
+    pattern: /([က-အ])္([က-အ])/g,
+    replace: (match: string, first: string, second: string): string => {
+      const firstRoman = MYANMAR_TO_ROMAN[first] || first;
+      const secondRoman = MYANMAR_TO_ROMAN[second] || second;
+      // 移除第一个辅音的固有元音 'a'
+      return firstRoman.slice(0, -1) + secondRoman;
+    },
+  },
+];
+
+// 后处理规则
+const POST_PROCESSING_RULES: ConversionRule[] = [
+  // 清理连续相同元音
+  { pattern: /aa/g, replace: "ā" },
+  { pattern: /ii/g, replace: "ī" },
+  { pattern: /uu/g, replace: "ū" },
+
+  // 清理辅音间多余的 'a'
+  { pattern: /([kgcjṭḍtdpbmylrsvh])a([kgcjṭḍtdpbmylrsvh])/g, replace: "$1$2" },
+
+  // 清理多余空格
+  { pattern: /\s+/g, replace: "" },
+];
+
+/**
+ * 将缅文巴利文转换为罗马巴利文
+ * @param myanmarText - 输入的缅文巴利文本
+ * @returns 转换后的罗马巴利文本
+ */
+export function convertMyanmarPaliToRoman(myanmarText: string): string {
+  if (!myanmarText || typeof myanmarText !== "string") {
+    return "";
+  }
+
+  let result = myanmarText;
+
+  // 应用特殊转换规则
+  result = applyConversionRules(result, SPECIAL_CONVERSION_RULES);
+
+  // 逐字符转换
+  result = result
+    .split("")
+    .map((char: string) => MYANMAR_TO_ROMAN[char] || char)
+    .join("");
+
+  // 应用后处理规则
+  result = applyConversionRules(result, POST_PROCESSING_RULES);
+
+  // 清理首尾空格
+  return result.trim();
+}
+
+/**
+ * 应用转换规则
+ * @param text - 要处理的文本
+ * @param rules - 转换规则数组
+ * @returns 处理后的文本
+ */
+function applyConversionRules(text: string, rules: ConversionRule[]): string {
+  let result = text;
+
+  for (const rule of rules) {
+    if (typeof rule.replace === "function") {
+      result = result.replace(rule.pattern, rule.replace);
+    } else {
+      result = result.replace(rule.pattern, rule.replace);
+    }
+  }
+
+  return result;
+}
+
+/**
+ * 批量转换缅文巴利文本数组
+ * @param myanmarTexts - 缅文巴利文本数组
+ * @returns 转换后的罗马巴利文本数组
+ */
+export function convertMyanmarPaliArrayToRoman(
+  myanmarTexts: string[]
+): string[] {
+  return myanmarTexts.map((text) => convertMyanmarPaliToRoman(text));
+}
+
+/**
+ * 检查文本是否包含缅文字符
+ * @param text - 要检查的文本
+ * @returns 是否包含缅文字符
+ */
+export function containsMyanmarCharacters(text: string): boolean {
+  const myanmarRange = /[\u1000-\u109F]/;
+  return myanmarRange.test(text);
+}
+
+/**
+ * 转换选项接口
+ */
+export interface ConversionOptions {
+  /** 是否保留原始标点符号 */
+  preservePunctuation?: boolean;
+  /** 是否转换数字 */
+  convertNumbers?: boolean;
+  /** 自定义字符映射 */
+  customMapping?: CharacterMapping;
+}
+
+/**
+ * 带选项的缅文巴利转罗马巴利转换函数
+ * @param myanmarText - 输入的缅文巴利文本
+ * @param options - 转换选项
+ * @returns 转换后的罗马巴利文本
+ */
+export function convertMyanmarPaliToRomanWithOptions(
+  myanmarText: string,
+  options: ConversionOptions = {}
+): string {
+  if (!myanmarText || typeof myanmarText !== "string") {
+    return "";
+  }
+
+  const {
+    preservePunctuation = true,
+    convertNumbers = true,
+    customMapping = {},
+  } = options;
+
+  // 合并字符映射
+  const mapping: CharacterMapping = { ...MYANMAR_TO_ROMAN, ...customMapping };
+
+  // 如果不转换数字,从映射中移除数字
+  if (!convertNumbers) {
+    const numberKeys = ["၀", "၁", "၂", "၃", "၄", "၅", "၆", "၇", "၈", "၉"];
+    numberKeys.forEach((key) => delete mapping[key]);
+  }
+
+  // 如果不保留标点符号,从映射中移除标点
+  if (!preservePunctuation) {
+    const punctuationKeys = ["၊", "။", "၍", "၎"];
+    punctuationKeys.forEach((key) => delete mapping[key]);
+  }
+
+  let result = myanmarText;
+
+  // 应用特殊转换规则
+  result = applyConversionRules(result, SPECIAL_CONVERSION_RULES);
+
+  // 逐字符转换
+  result = result
+    .split("")
+    .map((char: string) => mapping[char] || char)
+    .join("");
+
+  // 应用后处理规则
+  result = applyConversionRules(result, POST_PROCESSING_RULES);
+
+  return result.trim();
+}
+
+/**
+ * 转换结果接口
+ */
+export interface ConversionResult {
+  /** 原始缅文文本 */
+  original: string;
+  /** 转换后的罗马文本 */
+  converted: string;
+  /** 是否成功转换 */
+  success: boolean;
+  /** 错误信息(如果有) */
+  error?: string;
+}
+
+/**
+ * 安全的缅文巴利转换函数,返回详细结果
+ * @param myanmarText - 输入的缅文巴利文本
+ * @returns 转换结果对象
+ */
+export function safeConvertMyanmarPaliToRoman(
+  myanmarText: string
+): ConversionResult {
+  try {
+    if (!myanmarText || typeof myanmarText !== "string") {
+      return {
+        original: myanmarText || "",
+        converted: "",
+        success: false,
+        error: "Invalid input: text must be a non-empty string",
+      };
+    }
+
+    const converted = convertMyanmarPaliToRoman(myanmarText);
+
+    return {
+      original: myanmarText,
+      converted,
+      success: true,
+    };
+  } catch (error) {
+    return {
+      original: myanmarText || "",
+      converted: "",
+      success: false,
+      error: error instanceof Error ? error.message : "Unknown error occurred",
+    };
+  }
+}
+
+// 导出字符映射表和规则(供高级用户使用)
+export { MYANMAR_TO_ROMAN, SPECIAL_CONVERSION_RULES, POST_PROCESSING_RULES };
+
+// 使用示例:
+/*
+// 基本使用
+const romanText = convertMyanmarPaliToRoman('ဗုဒ္ဓ');
+console.log(romanText); // 输出: "buddha"
+
+// 批量转换
+const myanmarTexts = ['ဗုဒ္ဓ', 'ဓမ္မ', 'သံဃ'];
+const romanTexts = convertMyanmarPaliArrayToRoman(myanmarTexts);
+console.log(romanTexts); // 输出: ["buddha", "dhamma", "saṅgha"]
+
+// 带选项的转换
+const romanTextWithOptions = convertMyanmarPaliToRomanWithOptions(
+  'ဗုဒ္ဓ ၁၂၃', 
+  { convertNumbers: false }
+);
+
+// 安全转换
+const result = safeConvertMyanmarPaliToRoman('ဗုဒ္ဓ');
+if (result.success) {
+  console.log(result.converted);
+} else {
+  console.error(result.error);
+}
+*/