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.
Cause:
The test fails when running the testTagString2() of CWSTaggerTest.java. After analyzing and testing, I found that it was this line of code that was at fault:
assertTrue(s.startsWith("中文 分词 "));
This is caused by the actual result obtained from s being different from the assertTrue parameter. This was fixed by changing the assertTrue parameter to the actual value.
Steps to Reproduce:
First, download all the required models from the GitHub page the author mentioned
Then run
mvn install fnlp-core -am -DskipTests
, this would download all the required dependency, and build the environment. So fall all build should successThen run
mvn -pl fnlp-core test -Dtest=org.fnlp.nlp.cn.tag.CWSTaggerTest
, this is to do the test. At this time a failure should be expected.Part of the error message:
Proposed Solution:
After analyzing, I found that all the function calls are working without any problem, so all the other tests except testTagString2() are able to pass without any problem. Then when looking at the assertTrue parameter, I realized that there is a difference between the value here and the value I actually get. This was resolved by changing s.startsWith to s.equals.