8858bd041f8d0fac28a45db47da4764f0dee3e52,aocr/util/data_gen.py,DataGen,convert_lex,#DataGen#Any#,75
Before Change
assert lex and len(lex) < self.bucket_specs[-1][1]
word = [self.GO_ID]
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)
return word
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: 6
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: 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
Project Name: biocore/scikit-bio
Commit Name: 7f20bc80922c8f24ceece7e335750655179090d2
Time: 2015-04-29
Author: ebolyen@gmail.com
File Name: skbio/io/_base.py
Class Name:
Method Name: _decode_qual_to_phred