Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: lookup's result should match the whole word only #77

Open
awxiaoxian2020 opened this issue Jul 29, 2023 · 3 comments
Open

Comments

@awxiaoxian2020
Copy link

由于一些原因,我的词典里出现了:

compromise.compromise两种单词,能否通过一些方式,返回后者。

@terasum
Copy link
Owner

terasum commented Jul 30, 2023

因为内部排序的时候会把.给替换掉,因为是一个特殊字符,后续我将多给一个参数处理这个问题

@awxiaoxian2020
Copy link
Author

现在可以说一下临时的解决方案吗?比如我可以注释掉哪一句源码之类的

@terasum
Copy link
Owner

terasum commented Jul 30, 2023

试试把 utils.js里面的

const REGEXP_STRIPKEY = {
  mdx: /[()., '/\\@_\$]()/g,
  mdd: /([.][^.]*$)|[()., '/@]/g, // strip '.' before file extension that is keeping the last period
};

改成

const REGEXP_STRIPKEY = {
  mdx: /[(), '/\\@_\$]()/g,
  mdd: /([.][^.]*$)|[()., '/@]/g, // strip '.' before file extension that is keeping the last period
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants