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

LZW compression algorithm #1706

Open
wants to merge 15 commits into
base: master
from
Open

LZW compression algorithm #1706

wants to merge 15 commits into from

Conversation

@Quentin61
Copy link

Quentin61 commented Jan 22, 2020

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 '_'.

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.

This PR is NOT ready for review

compression/lzw.py Outdated Show resolved Hide resolved
compression/lzw_main.py Outdated Show resolved Hide resolved
Quentin61 and others added 3 commits Jan 22, 2020
@cclauss
Copy link
Member

cclauss commented Jan 22, 2020

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.

Copy link
@cclauss

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'
        """
@onlinejudge95
Copy link
Collaborator

onlinejudge95 commented Feb 17, 2020

@Quentin61 I would like to see this in our collection, please reach out in case of any help required

cclauss and others added 2 commits Feb 17, 2020
@github-actions github-actions bot force-pushed the Quentin61:lzw branch from 6e75dc3 to c2de2dc Feb 17, 2020
cclauss and others added 3 commits Mar 14, 2020
github-actions github-actions
@cclauss cclauss marked this pull request as ready for review Mar 14, 2020
cclauss and others added 2 commits Mar 14, 2020
@github-actions github-actions bot force-pushed the Quentin61:lzw branch from 2cb3b43 to 97baf7e Mar 14, 2020
cclauss and others added 2 commits Mar 14, 2020
github-actions github-actions
Copy link
Member

cclauss left a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.