EasyDict


查词的,点高级选项可以看使用说明,感觉能覆盖不少正则场景了

AI的API怎么设置呢,不懂

可以去阿里云申请个api key,有一定的免费额度,感觉放词典里能用很久
api key填进去保存就可以了

If goal is to normalize a text field, which is better?

For normalizing a text field,

casefold() is the better choice.

Because it follows the Unicode Case Folding standard, it ensures that your data is truly normalized for searching, indexing, or deduplication across different languages. Using lower() can lead to “false negatives”—where two strings that mean the same thing are treated as different because of unique character behaviors.

Best Practices for Normalization:

  1. Use casefold() to eliminate casing differences.
  2. Use strip() to remove leading/trailing whitespace.
  3. Use unicodedata.normalize() if you need to handle accented characters (e.g., matching “é” created with one character vs. “e” + a combining accent).

To normalize a text field that includes

accented characters, you should combine casefold() with the unicodedata module.

A single “accented character” can sometimes be represented in two different ways in Unicode (e.g., é as a single code point vs. e + a combining accent). To ensure these match, you must normalize their Unicode form.

The Normalization Strategy

  1. Decompose the characters: Use unicodedata.normalize('NFD', ...) to separate accents from their base letters (e.g., é becomes e + ´).
  2. Filter out accents (Optional): If your goal is to remove accents entirely (e.g., matching “café” to “cafe”), you can filter out characters identified as “combining”.
  3. Apply Casefolding: Use .casefold() to handle case-insensitive matching.

Recommended Python Implementation

This function provides robust normalization by stripping accents and equalizing case:

python

import unicodedata

def normalize_text(text):
    # 1. Decompose into base characters and accents (NFD)
    # 2. Filter out characters that are "combining marks" (accents)
    # 3. Casefold to ensure caseless matching
    return "".join(
        c for c in unicodedata.normalize('NFD', text)
        if not unicodedata.combining(c)
    ).casefold()

# Example usage:
print(normalize_text("Café"))  # Output: "cafe"
print(normalize_text("Straße")) # Output: "strasse"

好的,谢谢……

感谢反馈,跟进了


更新一些效果样式,兼容了英语应用语言



更新1.2.8版本,AI聊天已经处于基本可用的阶段,有着符合常识、符合习惯的UI

:+1:一直觉得DICT server用起来很方便,这个像是现代的DICT server。

看起来很强大~技术小白先去下载体验下= =

光看界面是很不错,AI配置啥的也都有,很齐全。
但我下了站里的《现代汉语词典》第七版。词典管理也有了,但不能查,不知怎么回事。
不知道哪里有词典下载,我看还有在线订阅,不知道哪里有地址。小白不太会,不知道能不能把mdx转成这个软件的词典。

顶楼有词典服务器地址的,你仔细看看
在词典服务器里下词典,服务器里有现代汉语词典7,他之前的那版不支持了

好的,谢谢。我来找找看

有个功能希望加一下,就是选中文字后会在在菜单上显示app查词。

这个确实很重要,之前实现的时候遇到了点困难,以后再看看怎么弄

因为很多数据是网页上的,需要支持 RFC 3986

比如”Hibbing,_Minnesota“应该在搜索“Hibbing, Minnesota”的时候算等同,反之亦然。

好像python没有完全支持RFC的,可以用

  • To Encode: urllib.parse.quote()
  • To Decode: urllib.parse.unquote()

Java (java.net.URI)Javascript ( encodeURIComponent + URL API)都有专门支持RFC的。

这个标记了,之后改

问题反馈
1.这里的部分词典下载后无法使用


2.在“词典管理-词典排序”中对词典排序后,词典解释界面没有发生改变

这两个都是ai测试生成的假词典,我一直忘了删

词典排序问题下个版本改进

这个词典是只能从服务器下载词典,不支持本地词典导入吗?(º﹃º )