8858bd041f8d0fac28a45db47da4764f0dee3e52,aocr/util/data_gen.py,DataGen,convert_lex,#DataGen#Any#,75

Before Change


        for char in lex:
            assert 96 < ord(char) < 123 or 47 < ord(char) < 58
            word.append(
                ord(char) - 97 + 13 if ord(char) > 96 else ord(char) - 48 + 3)
        word.append(self.EOS_ID)
        word = np.array(word, dtype=np.int32)

After Change


    def convert_lex(self, lex):
        assert lex and len(lex) < self.bucket_specs[-1][1]

        return np.array(
            [self.GO_ID] + [self.CHARMAP.index(char) for char in lex.upper()] + [self.EOS_ID],
            dtype=np.int32)


    @staticmethod
    def _parse_record(example_proto):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: emedvedev/attention-ocr
Commit Name: 8858bd041f8d0fac28a45db47da4764f0dee3e52
Time: 2017-08-10
Author: edward.medvedev@gmail.com
File Name: aocr/util/data_gen.py
Class Name: DataGen
Method Name: convert_lex


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 155686c863a95139f8683b77d9d030a8d3654441
Time: 2014-12-03
Author: ehankland@google.com
File Name: perfkitbenchmarker/gcp/gce_virtual_machine.py
Class Name: GceVirtualMachine
Method Name: GetLocalDrives


Project Name: commonsense/conceptnet5
Commit Name: 3a390e0add5588c3b4cb2cb29f14314b8b96e14b
Time: 2014-03-13
Author: rob@luminoso.com
File Name: conceptnet5/web_interface/utils.py
Class Name:
Method Name: get_sorted_languages