Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修改方式
中英文替换之后,没有再次调整空格,这个问题影响还挺大的。比如邮箱输入的时候,艾特改成@,导致后面的总是多一个空格出来很麻烦。
我的修改方式是追加两行代码,让它再次调整。
经过我的测试,这样的修改是可行的。
备注
为了不重写代码或者设置两遍变量,我增加了一个全局变量文件,用来共享 client 和 server 的信息。
不过,实际上,全局变量文件应该只存储变量,而不存储代码。所以按照开发时的规范重复的函数应该放在 utils 的那个文件夹下。
但是我看了一下你的程序会将 utils 下面的代码都打包一遍,我不清楚你的程序是如何打包的,所以我没有在这个模块下贸然添加任何代码,就全写在全局变量的文件里面了。
总之,这是一个修改示意~如果你采纳的话,有不符合你的代码逻辑的部分,请直接修改。
修改测试结果
我的测试结果如下,[email protected],一 Hz,180Hz,[email protected]
为了准确识别邮箱和网址,我新增的热词(在
hot-rule.txt
下)如下:对于识别邮箱这个功能点,我认为应该是工具的特性,所以我没有交到这个解决 bug 的 PR 里面,如果你希望加上该特性的话,你可以直接加到热词里。