Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Unimplemented function in PermutationDecoder #398

Copy link
Copy link
@lucasmoura

Description

@lucasmoura
Issue body actions

In the PermutationDecoder class, there is a method named score which makes a call to permutation_decode. However, this function is not implemented in the project.

    def score(self, code):
        """Score is product of word scores, unigram scores, and bigram scores.
        This can get very small, so we use logs and exp."""
        text = permutation_decode(self.ciphertext, code)
        logP = (sum([log(self.Pwords[word]) for word in words(text)]) +
                sum([log(self.P1[c]) for c in text]) +
                sum([log(self.P2[b]) for b in bigrams(text)]))
        return exp(logP)

This function was renamed in commit 516b6f2, from decode to permutation_decode. However, I could not trace even the original decode function, which first appear in commit 2bd2348.

Therefore, I do believe this function needs to be implemented in order for the method to work properly.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.