@siact/sime-x-vue 0.0.24 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1512,11 +1512,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1512
1512
  }
1513
1513
  };
1514
1514
  const test = () => {
1515
- [
1516
- "1你好,世界,今天是想起五天气横扫的缺点",
1517
- "2你好,世界,今天是想起五天气横扫的缺点",
1518
- "3你好,世界,今天是想起五天气横扫的缺点"
1519
- ].forEach((text, index) => {
1515
+ ["0.732~0.8124"].forEach((text, index) => {
1520
1516
  setTimeout(() => {
1521
1517
  aiChatbotX.speakText(text).call(() => {
1522
1518
  console.log("speak end");
@@ -1688,7 +1684,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1688
1684
  }
1689
1685
  });
1690
1686
 
1691
- const commandTest = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-3d80e12e"]]);
1687
+ const commandTest = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-74573d6c"]]);
1692
1688
 
1693
1689
  class CommandManager {
1694
1690
  commands = /* @__PURE__ */ new Map();
@@ -1825,19 +1821,34 @@ function useTTS(getVoiceConfig) {
1825
1821
  }
1826
1822
  return -1;
1827
1823
  };
1824
+ const DIGIT_TO_CN = {
1825
+ "0": "零",
1826
+ "1": "一",
1827
+ "2": "二",
1828
+ "3": "三",
1829
+ "4": "四",
1830
+ "5": "五",
1831
+ "6": "六",
1832
+ "7": "七",
1833
+ "8": "八",
1834
+ "9": "九"
1835
+ };
1828
1836
  const normalizeNumbers = (text) => {
1829
1837
  return text.replace(/(-?\d[\d,]*\.?\d*)\s*%/g, (_, num) => {
1830
1838
  const cleanNum = num.replace(/,/g, "");
1831
1839
  const n = parseFloat(cleanNum);
1832
- const spoken = cleanNum.replace(".", "点");
1840
+ const [intPart, decPart] = cleanNum.split(".");
1841
+ let spoken = intPart;
1842
+ if (decPart) spoken += "点" + decPart.replace(/\d/g, (d) => DIGIT_TO_CN[d] || d);
1833
1843
  if (n < 0) return `负百分之${spoken.replace("-", "")}`;
1834
1844
  return `百分之${spoken}`;
1835
1845
  }).replace(/(-?\d[\d,]*)\.(\d+)/g, (_, intPart, decPart) => {
1836
1846
  const cleanInt = intPart.replace(/,/g, "");
1847
+ const decCn = decPart.replace(/\d/g, (d) => DIGIT_TO_CN[d] || d);
1837
1848
  if (cleanInt.startsWith("-")) {
1838
- return `负${cleanInt.slice(1)}点${decPart}`;
1849
+ return `负${cleanInt.slice(1)}点${decCn}`;
1839
1850
  }
1840
- return `${cleanInt}点${decPart}`;
1851
+ return `${cleanInt}点${decCn}`;
1841
1852
  }).replace(/-(\d)/g, "负$1");
1842
1853
  };
1843
1854
  const stripMarkdown = (text) => {