개정판 f5002159
pi text
Change-Id: I3d26026badeb577e873607ed9174b04a392cc7f9
DTI_PID/DTI_PID/OcrResultDialog.py | ||
---|---|---|
305 | 305 | |
306 | 306 |
try: |
307 | 307 |
text = self.ui.detectResultTextEdit.toPlainText() |
308 |
text = TextInfo.text_filter(text) |
|
308 | 309 |
if text == '' or text == 'Not Found': |
309 | 310 |
if show: |
310 | 311 |
QMessageBox.about(self.ui.ocrDialogButtonBox, self.tr('Notice'), |
DTI_PID/DTI_PID/TextInfo.py | ||
---|---|---|
4 | 4 | |
5 | 5 |
class TextInfo: |
6 | 6 |
def __init__(self, text, x, y, w, h, angle): |
7 |
self._text = self.text_filter(text)
|
|
7 |
self._text = TextInfo.text_filter(text)
|
|
8 | 8 |
self.text_area = QRect(x, y, w, h) |
9 | 9 |
""" |
10 | 10 |
self.x = x |
... | ... | |
85 | 85 |
def getAngle(self): |
86 | 86 |
return self.angle |
87 | 87 |
|
88 |
def text_filter(self, text): |
|
88 |
staticmethod |
|
89 |
def text_filter(text): |
|
89 | 90 |
""" fix input text """ |
90 |
text = text.replace('—', '-').replace('--', '-').replace('”', '"') |
|
91 |
text = text.replace('—', '-').replace('--', '-').replace('”', '"').replace(r'%%C', 'Ø')
|
|
91 | 92 |
return text |
내보내기 Unified diff