Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unimplemented function in PermutationDecoder #398

Closed
@lucasmoura

Description

@lucasmoura

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.

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