-
Notifications
You must be signed in to change notification settings - Fork 744
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
Add list_from_file and list_to_file #226
Conversation
Signed-off-by: lizz <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #226 +/- ##
==========================================
+ Coverage 85.94% 85.96% +0.02%
==========================================
Files 131 132 +1
Lines 8807 8807
Branches 1239 1239
==========================================
+ Hits 7569 7571 +2
+ Misses 936 934 -2
Partials 302 302
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
line = line.strip() | ||
if line != '': | ||
self.idx2char.append(line) | ||
for line in list_from_file(dict_file): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BE CAREFUL. MAKE SURE THERE IS NO PROBLEM ABOUT SOME CHARACTERS SUCH AS CHINESE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add tests on that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Add list_from_file and list_to_file Signed-off-by: lizz <[email protected]> * Add test list_to_file and list_from_file * more * Fix tests
* Add list_from_file and list_to_file Signed-off-by: lizz <[email protected]> * Add test list_to_file and list_from_file * more * Fix tests
This simplifies code, and avoids direct manipulations of text io.