diff --git a/.gitignore b/.gitignore index df20151..9f33c04 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .vscode/ nohup.out data/ +__pycache__ \ No newline at end of file diff --git a/__pycache__/dataHandler.cpython-37.pyc b/__pycache__/dataHandler.cpython-37.pyc deleted file mode 100644 index 734e21f..0000000 Binary files a/__pycache__/dataHandler.cpython-37.pyc and /dev/null differ diff --git a/__pycache__/dataHandler.cpython-38.pyc b/__pycache__/dataHandler.cpython-38.pyc deleted file mode 100755 index 946594b..0000000 Binary files a/__pycache__/dataHandler.cpython-38.pyc and /dev/null differ diff --git a/__pycache__/dataHandlerPTT.cpython-37.pyc b/__pycache__/dataHandlerPTT.cpython-37.pyc deleted file mode 100644 index f5f34c7..0000000 Binary files a/__pycache__/dataHandlerPTT.cpython-37.pyc and /dev/null differ diff --git a/__pycache__/generalText.cpython-37.pyc b/__pycache__/generalText.cpython-37.pyc deleted file mode 100644 index 094ea0a..0000000 Binary files a/__pycache__/generalText.cpython-37.pyc and /dev/null differ diff --git a/app.py b/app.py index 0471be9..b1ef199 100755 --- a/app.py +++ b/app.py @@ -126,4 +126,4 @@ def initPage(): if __name__ == "__main__": - app.run(debug=False, port=4980, host='0.0.0.0', threaded=True) + app.run(debug=True, port=4999, host='0.0.0.0', threaded=True) diff --git a/dataHandlerPTT.py b/dataHandlerPTT.py index e314dc8..209e53a 100755 --- a/dataHandlerPTT.py +++ b/dataHandlerPTT.py @@ -91,35 +91,35 @@ def filterPOS(content, aid): startTime = time() cutted = [] for i in cuttedWithPOS: - if (i.flag[0] == 'n' or i.flag[0] == 'N'): + if (i['flag'][0] == 'n' or i['flag'][0] == 'N'): if (pos['noun']): - cutted.append(i.word) - elif (i.flag[0] == 'v' or (i.flag[0] == 'V' and i.flag != 'Vi')): + cutted.append(i['word']) + elif (i['flag'][0] == 'v' or (i['flag'][0] == 'V' and i['flag'] != 'Vi')): if (pos['verb']): - cutted.append(i.word) - elif (i.flag == 'Vi'): + cutted.append(i['word']) + elif (i['flag'] == 'Vi'): if (pos['adj']): - cutted.append(i.word) - elif (i.flag == 'ADV'): + cutted.append(i['word']) + elif (i['flag'] == 'ADV'): if (pos['adv']): - cutted.append(i.word) - elif (i.flag == 'r'): + cutted.append(i['word']) + elif (i['flag'] == 'r'): if (pos['pron']): - cutted.append(i.word) - elif (i.flag == 'POST' or i.flag == 'T'): + cutted.append(i['word']) + elif (i['flag'] == 'POST' or i['flag'] == 'T'): if (pos['aux']): - cutted.append(i.word) + cutted.append(i['word']) else: if (pos['other']): - if(i.flag != 'eng' and i.flag != 'x' and i.flag != 'm'): - cutted.append(i.word) + if(i['flag'] != 'eng' and i['flag'] != 'x' and i['flag'] != 'm'): + cutted.append(i['word']) else: - if (i.word == content['keyword']): - cutted.append(i.word) + if (i['word'] == content['keyword']): + cutted.append(i['word']) else: cuttedWithPOS = data.posseg(aid) - cutted = [i.word for i in cuttedWithPOS if ( - i.flag != 'eng' and i.flag != 'x' and i.flag != 'm')] + cutted = [i['word'] for i in cuttedWithPOS if ( + i['flag'] != 'eng' and i['flag'] != 'x' and i['flag'] != 'm')] if('stopwords' in content): stopwords = content['stopwords'] else: