Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upLZW compression algorithm #1706
Open
Conversation
|
OK... Now we pass the Travis CI tests. We need to add some type annotations and doctests. |
| def __init__(self): | ||
| """ | ||
| Dictionary constructor | ||
| """ |
This comment has been minimized.
This comment has been minimized.
cclauss
Jan 22, 2020
Member
Please add doctests like this...
class Dictionary:
def __init__(self):
"""
Dictionary constructor
>>> d = Dictionary()
>>> d.search("?")
-1
>>> d.search("")
-2
>>> d.print_dictionary()
>>> d.add_to_dictionary("A")
>>> d.search("?")
-1
>>> d.search("")
-2
>>> d.search("A")
'A'
>>> d.print_dictionary()
'A'
"""
|
@Quentin61 I would like to see this in our collection, please reach out in case of any help required |
|
https://travis-ci.com/github/TheAlgorithms/Python/jobs/298116329#L1079 Is a problem. This is why we write tests. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Quentin61 commentedJan 22, 2020
•
edited
Describe your change:
I've created an algorithm to compress and decompresse strings with the LZW method. The compressed string is formated in ASCII code separated into '_'.
Fix a bug or typo in an existing algorithm?Documentation change?Checklist:
This PR is NOT ready for review