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
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)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
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: facebookresearch/pytext
Commit Name: bc6e778bc0523f463ae17ffe6f32ce2c3ff4e7b4
Time: 2019-03-12
Author: snl@fb.com
File Name: pytext/data/test/tensorizers_test.py
Class Name: TensorizersTest
Method Name: test_create_byte_tensors