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

refactor: 给部分代码添加注释 #37

Merged
merged 6 commits into from Sep 6, 2021

Conversation

michaelfyc
Copy link
Member

@michaelfyc michaelfyc commented Aug 31, 2021

根据 #35 的editorconfig文件更改了大部分代码缩进
给 ArticleCompareUtil 添加注释,把 main 的测试移到 test 目录下做单元测试
把工具类的 main 测试移动到 test 目录下
给 ICheckService 和 ICheckServiceImpl 添加注释,并调整了部分写法
将部分类或者函数的注释改成javadoc格式的注释
给 LeaderBoard 添加了注释并调整了部分写法

@michaelfyc michaelfyc linked an issue Aug 31, 2021 that may be closed by this pull request
@michaelfyc michaelfyc force-pushed the michaelfyc-add-ut-20210830 branch 2 times, most recently from d9cc2c0 to d99afbe Compare August 31, 2021 03:58
}
private final static Logger log = LoggerFactory.getLogger(ICheckServiceImpl.class);
/**
* unicode 编码中,中文字符占两个字节,因此文本最大长度设为2000而非1000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个正确吗?我调试来看获取的长度是正确的,并没有*2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不知道,我没改这里的代码🤔如果没有乘2的话那么related的长度是不是也不用除以2了?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2000是因为我设置的就是2000,想要和前端统一的话改成1000就好了()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改了

@michaelfyc michaelfyc force-pushed the michaelfyc-add-ut-20210830 branch 2 times, most recently from 2c5d87b to e988dcb Compare August 31, 2021 09:42
Copy link
Member

@stream2000 stream2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look very good to me😘

}
return stringSegs;
}
static List<String> getStringSegs(String s) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此函数使用滑动窗口将字符串分段以便比较,用到的地方就是两个文本段相同部分的标记(compareArticle函数)。可以换成新的算法来标记(前端用上了)。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释加上了。

可以换成新的算法来标记(前端用上了)。

这个怎么说?

@michaelfyc michaelfyc added this to In progress in ASoulCnkiBackend Sep 6, 2021
@michaelfyc michaelfyc merged commit 2e3f848 into ASoulCnki:master Sep 6, 2021
ASoulCnkiBackend automation moved this from In progress to Done Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

逐步给代码补上注释
3 participants