def __init__(self, main): super().__init__(main, main.tr('Need Help?'), width = 500, height = 460) self.label_need_help = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> If you encounter a problem, find a bug, or require any further information, feel free to ask questions, submit bug reports, or provide feedback by <a href="https://github.com/BLKSerene/Wordless/issues/new">creating an issue</a> on Github if you fail to find the answer by searching <a href="https://github.com/BLKSerene/Wordless/issues">existing issues</a> first. </div> <div> If you need to post sample texts or other information that cannot be shared or you do not want to share publicly, you may send me an email. </div> '''), self ) self.table_need_help = wordless_table.Wordless_Table(self, headers = [ self.tr('Platforms'), self.tr('Contact Information') ], cols_stretch = [ self.tr('Contact Information') ]) self.table_need_help.setRowCount(4) self.table_need_help.verticalHeader().setHidden(True) self.table_need_help.setCellWidget(0, 0, wordless_label.Wordless_Label_Html(self.tr('Home Page'), self)) self.table_need_help.setCellWidget(0, 1, wordless_label.Wordless_Label_Html('<a href="https://github.com/BLKSerene/Wordless">https://github.com/BLKSerene/Wordless</a>', self)) self.table_need_help.setCellWidget(1, 0, wordless_label.Wordless_Label_Html(self.tr('Documentation'), self)) self.table_need_help.setCellWidget(1, 1, wordless_label.Wordless_Label_Html('<a href="https://github.com/BLKSerene/Wordless#-documentation">https://github.com/BLKSerene/Wordless#-documentation</a>', self)) self.table_need_help.setCellWidget(2, 0, wordless_label.Wordless_Label_Html(self.tr('Email'), self)) self.table_need_help.setCellWidget(2, 1, wordless_label.Wordless_Label_Html('<a href="mailto:[email protected]">[email protected]</a><br><a href="mailto:[email protected]">[email protected]</a>', self)) self.table_need_help.setCellWidget(3, 0, wordless_label.Wordless_Label_Html(self.tr('<a href="https://www.wechat.com/en/">WeChat</a> Official Account'), self)) self.table_need_help.setCellWidget(3, 1, wordless_label.Wordless_Label_Html('<img src="imgs/wechat_official_account.dib">', self)) self.label_need_help_note = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> <span style="color: #F00;"><b>Important Note</b></span>: I <b>CANNOT GUARANTEE</b> that all emails will always be checked or replied in time. I <b>WILL NOT REPLY</b> to irrelevant emails and I reserve the right to <b>BLOCK AND/OR REPORT</b> people who send me spam emails. </div> '''), self ) self.wrapper_info.layout().addWidget(self.label_need_help, 0, 0) self.wrapper_info.layout().addWidget(self.table_need_help, 1, 0) self.wrapper_info.layout().addWidget(self.label_need_help_note, 2, 0)
def __init__(self, main, on_startup=False): super().__init__(main, main.tr('Check for Updates'), width=420, no_button=True) self.on_startup = on_startup self.label_check_updates = wordless_label.Wordless_Label_Dialog( '', self) self.checkbox_check_updates_on_startup = QCheckBox( self.tr('Check for updates on startup'), self) self.button_try_again = QPushButton(self.tr('Try Again'), self) self.button_cancel = QPushButton(self.tr('Cancel'), self) self.checkbox_check_updates_on_startup.stateChanged.connect( self.check_updates_on_startup_changed) self.button_try_again.clicked.connect(self.check_updates) self.wrapper_info.layout().addWidget(self.label_check_updates, 0, 0) self.wrapper_buttons.layout().addWidget( self.checkbox_check_updates_on_startup, 0, 0) self.wrapper_buttons.layout().addWidget(self.button_try_again, 0, 2) self.wrapper_buttons.layout().addWidget(self.button_cancel, 0, 3) self.wrapper_buttons.layout().setColumnStretch(1, 1) self.load_settings() self.set_fixed_height()
def __init__(self, main): if platform.system() == 'Windows': super().__init__(main, main.tr('Citing'), width=400, height=200, no_button=True) elif platform.system() == 'Darwin': super().__init__(main, main.tr('Citing'), width=400, height=250, no_button=True) self.label_citing = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> If you publish work that uses Wordless, please cite as follows. </div> '''), self) self.label_citation_sys = QLabel(self.tr('Citation System:'), self) self.combo_box_citation_sys = wordless_box.Wordless_Combo_Box(self) self.text_edit_citing = QTextEdit(self) self.button_copy = QPushButton(self.tr('Copy'), self) self.button_close = QPushButton(self.tr('Close'), self) self.combo_box_citation_sys.addItems([ self.tr('MLA (8th Edition)'), self.tr('APA (6th Edition)'), self.tr('GB (GB/T 7714—2015)') ]) self.button_copy.setFixedWidth(100) self.button_close.setFixedWidth(100) self.text_edit_citing.setFixedHeight(100) self.text_edit_citing.setReadOnly(True) self.combo_box_citation_sys.currentTextChanged.connect( self.citation_sys_changed) self.button_copy.clicked.connect(self.copy) self.button_close.clicked.connect(self.accept) layout_citation_sys = wordless_layout.Wordless_Layout() layout_citation_sys.addWidget(self.label_citation_sys, 0, 0) layout_citation_sys.addWidget(self.combo_box_citation_sys, 0, 1) layout_citation_sys.setColumnStretch(2, 1) self.wrapper_info.layout().addWidget(self.label_citing, 0, 0, 1, 2) self.wrapper_info.layout().addLayout(layout_citation_sys, 1, 0, 1, 2) self.wrapper_info.layout().addWidget(self.text_edit_citing, 2, 0, 1, 2) self.wrapper_buttons.layout().addWidget(self.button_copy, 0, 0) self.wrapper_buttons.layout().addWidget(self.button_close, 0, 1) self.load_settings()
def __init__(self, main): super().__init__(main, main.tr('Exit'), width = 420, no_button = True) self.label_confirm_exit = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> Restart is required for font settings to take effect. Do you want to restart Wordless now? </div> <div style="font-weight: bold;"> Note: All unsaved data and figures will be lost. </div> '''), self ) self.button_restart = QPushButton(self.tr('Restart'), self) self.button_cancel = QPushButton(self.tr('Cancel'), self) self.button_restart.clicked.connect(self.accept) self.button_cancel.clicked.connect(self.reject) self.wrapper_info.layout().addWidget(self.label_confirm_exit, 0, 0) self.wrapper_buttons.layout().addWidget(self.button_restart, 0, 1) self.wrapper_buttons.layout().addWidget(self.button_cancel, 0, 2) self.wrapper_buttons.layout().setColumnStretch(0, 1) self.set_fixed_height()
def __init__(self, main, files_detection_error_encoding, files_detection_error_text_type, files_detection_error_lang): super().__init__(main, main.tr('Detection Error'), width=DIALOG_ERROR_WIDTH, height=DIALOG_ERROR_HEIGHT) self.label_error = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> An error occurred during auto-detection. Please set the settings of the following files manually. </div> '''), self) self.table_error_files = wordless_table.Wordless_Table_Error( self, headers=[self.tr('Error Types'), self.tr('Files')]) self.table_error_files.setFixedHeight(TABLE_ERROR_FILES_HEIGHT) self.table_error_files.setRowCount(0) self.button_export.clicked.connect(self.table_error_files.export_all) for file in files_detection_error_encoding: self.table_error_files.setRowCount( self.table_error_files.rowCount() + 1) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Encoding Detection'))) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) for file in files_detection_error_text_type: self.table_error_files.setRowCount( self.table_error_files.rowCount() + 1) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Text Type Detection'))) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) for file in files_detection_error_lang: self.table_error_files.setRowCount( self.table_error_files.rowCount() + 1) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Language Detection'))) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) self.wrapper_info.layout().addWidget(self.label_error, 0, 0) self.wrapper_info.layout().addWidget(self.table_error_files, 1, 0)
def __init__(self, main): if platform.system() in ['Windows', 'Darwin']: super().__init__(main, main.tr('About Wordless'), width=420, height=200) elif platform.system() == 'Linux': super().__init__(main, main.tr('About Wordless'), width=450, height=200) label_about_icon = QLabel('', self) img_wordless_icon = QPixmap('imgs/wordless_icon_about.png') img_wordless_icon = img_wordless_icon.scaled(64, 64) label_about_icon.setPixmap(img_wordless_icon) label_about_title = wordless_label.Wordless_Label_Dialog( self.tr(''' <div style="text-align: center;"> <h2>Wordless Version 1.0.0</h2> <div> An Integrated Corpus Tool with Multi-language Support<br> for the Study of Language, Literature and Translation </div> </div> '''), self) label_about_copyright = wordless_label.Wordless_Label_Dialog( self.tr(''' <hr> <div style="text-align: center;"> Copyright (C) 2018 Ye Lei (<span style="font-family: simsun">叶磊</span>)<br> Licensed Under GNU GPLv3<br> All Other Rights Reserved </div> '''), self) self.wrapper_info.layout().addWidget(label_about_icon, 0, 0) self.wrapper_info.layout().addWidget(label_about_title, 0, 1) self.wrapper_info.layout().addWidget(label_about_copyright, 1, 0, 1, 2) self.wrapper_info.layout().setColumnStretch(1, 1) self.wrapper_info.layout().setVerticalSpacing(0)
def __init__(self, main, files_missing, files_empty, files_decoding_error): super().__init__(main, main.tr('Error Loading File'), width=DIALOG_ERROR_WIDTH, height=DIALOG_ERROR_HEIGHT) self.label_error = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> An error occurred while loading the following files. Please check the files and/or your settings and try again. </div> '''), self) self.table_error_files = wordless_table.Wordless_Table_Error( self, headers=[self.tr('Error Types'), self.tr('Files')]) self.table_error_files.setFixedHeight(TABLE_ERROR_FILES_HEIGHT) self.table_error_files.setRowCount(0) self.button_export.clicked.connect(self.table_error_files.export_all) for file in files_missing: self.table_error_files.setRowCount( self.table_error_files.rowCount() + 1) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Missing File'))) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) for file in files_empty: self.table_error_files.setRowCount( self.table_error_files.rowCount() + 1) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Empty File'))) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) for file in files_decoding_error: self.table_error_files.setRowCount( self.table_error_files.rowCount() + 1) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Decoding Error'))) self.table_error_files.setItem( self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) self.wrapper_info.layout().addWidget(self.label_error, 0, 0) self.wrapper_info.layout().addWidget(self.table_error_files, 1, 0)
def __init__(self, main, files_duplicate, files_empty, files_unsupported, files_parsing_error): super().__init__(main, main.tr('Error Opening File'), width = DIALOG_ERROR_WIDTH) self.label_error = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> An error occurred while opening the files, so the following files are skipped and will not be added to the file area. </div> '''), self ) self.table_error_files = wordless_table.Wordless_Table_Error(self, headers = [ self.tr('Error Types'), self.tr('Files') ]) self.table_error_files.setFixedHeight(TABLE_ERROR_FILES_HEIGHT) self.table_error_files.setRowCount(0) self.button_export.clicked.connect(self.table_error_files.export_table) for file in files_duplicate: self.table_error_files.setRowCount(self.table_error_files.rowCount() + 1) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Duplicate File'))) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) for file in files_empty: self.table_error_files.setRowCount(self.table_error_files.rowCount() + 1) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Empty File'))) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) for file in files_unsupported: self.table_error_files.setRowCount(self.table_error_files.rowCount() + 1) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Unsupported File Type'))) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) for file in files_parsing_error: self.table_error_files.setRowCount(self.table_error_files.rowCount() + 1) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Parsing Error'))) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) self.wrapper_info.layout().addWidget(self.label_error, 0, 0) self.wrapper_info.layout().addWidget(self.table_error_files, 1, 0)
def __init__(self, main): super().__init__(main, main.tr('Donating'), width=400, height=510) self.label_donating = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> If you would like to support the development of Wordless, you may donate via PayPal, Alipay or WeChat. </div> '''), self) self.label_donating_via = QLabel(self.tr('Donating via:'), self) self.combo_box_donating_via = wordless_box.Wordless_Combo_Box(self) self.label_donating_via_img = wordless_label.Wordless_Label_Html( '', self) self.label_donating_note = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> <span style="color: #F00;"><b>Important Note</b></span>: I <b>WILL NOT PROVIDE</b> refund services, private email/phone support, information concerning my social media, gurantees on bug fixes, enhancements, new features or new releases of Wordless, invoices, receipts or detailed weekly/monthly/yearly/etc. spending report for donation. </div> '''), self) self.combo_box_donating_via.addItems( [self.tr('PayPal'), self.tr('Alipay'), self.tr('WeChat')]) self.combo_box_donating_via.currentTextChanged.connect( self.donating_via_changed) layout_donating_via = wordless_layout.Wordless_Layout() layout_donating_via.addWidget(self.label_donating_via, 0, 0) layout_donating_via.addWidget(self.combo_box_donating_via, 0, 1) layout_donating_via.setColumnStretch(2, 1) self.wrapper_info.layout().addWidget(self.label_donating, 0, 0) self.wrapper_info.layout().addLayout(layout_donating_via, 1, 0) self.wrapper_info.layout().addWidget(self.label_donating_via_img, 2, 0, Qt.AlignHCenter | Qt.AlignVCenter) self.wrapper_info.layout().addWidget(self.label_donating_note, 3, 0) self.load_settings()
def __init__(self, main): super().__init__(main) self.time_start = time.time() self.timer_time_elapsed = QTimer(self) self.label_progress = QLabel('', self) self.label_time_elapsed = QLabel(self.tr('Elapsed Time: 0:00:00'), self) self.label_processing = wordless_label.Wordless_Label_Dialog(self.tr('Please wait. It may take a few seconds to several minutes for the operation to be completed.'), self) self.timer_time_elapsed.timeout.connect(self.update_elapsed_time) self.timer_time_elapsed.start(1000) self.setLayout(wordless_layout.Wordless_Layout()) self.layout().addWidget(self.label_progress, 0, 0) self.layout().addWidget(self.label_time_elapsed, 0, 1, Qt.AlignRight) self.layout().addWidget(self.label_processing, 1, 0, 1, 2) self.layout().setContentsMargins(20, 10, 20, 10)
def __init__(self, main): super().__init__(main, main.tr('Exit'), width = 420, no_button = True) self.label_confirm_exit = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> Are you sure you want to exit Wordless? </div> <div style="font-weight: bold;"> Note: All unsaved data and figures will be lost. </div> '''), self ) self.checkbox_confirm_on_exit = QCheckBox(self.tr('Always confirm on exit'), self) self.button_exit = QPushButton(self.tr('Exit'), self) self.button_cancel = QPushButton(self.tr('Cancel'), self) self.checkbox_confirm_on_exit.stateChanged.connect(self.confirm_on_exit_changed) self.button_exit.clicked.connect(self.accept) self.button_cancel.clicked.connect(self.reject) self.wrapper_info.layout().addWidget(self.label_confirm_exit, 0, 0) self.wrapper_buttons.layout().addWidget(self.checkbox_confirm_on_exit, 0, 0) self.wrapper_buttons.layout().addWidget(self.button_exit, 0, 2) self.wrapper_buttons.layout().addWidget(self.button_cancel, 0, 3) self.wrapper_buttons.layout().setColumnStretch(1, 1) self.load_settings() self.set_fixed_height()
def __init__(self, main): super().__init__(main, main.tr('Acknowledgments'), width=580) self.ACKS_GENERAL = [ [ '<a href="https://www.python.org/">Python</a>', '3.7.2', 'Guido van Rossum, Python Software Foundation', '<a href="https://docs.python.org/3.7/license.html#psf-license-agreement-for-python-release">PSF</a>' ], [ '<a href="https://www.riverbankcomputing.com/software/pyqt/intro">PyQt</a>', '5.12.1', 'Riverbank Computing Limited', '<a href="http://pyqt.sourceforge.net/Docs/PyQt5/introduction.html#license">GPL-3.0</a>' ] ] self.ACKS_NLP = [ [ main.tr('<a href="https://github.com/fxsjy/jieba">jieba</a>'), '0.39', 'Sun Junyi', '<a href="https://github.com/fxsjy/jieba/blob/master/LICENSE">MIT</a>' ], [ '<a href="https://github.com/taishi-i/nagisa">nagisa</a>', '0.2.1', 'Taishi Ikeda (池田大志)', '<a href="https://github.com/taishi-i/nagisa/blob/master/LICENSE.txt">MIT</a>' ], [ '<a href="http://www.nltk.org/">NLTK</a>', '3.4', 'Steven Bird, Liling Tan', '<a href="https://github.com/nltk/nltk/blob/develop/LICENSE.txt">Apache-2.0</a>' ], [ '<a href="https://github.com/Esukhia/pybo">pybo</a>', '0.4.2', 'Hélios Drupchen Hildt', '<a href="https://github.com/Esukhia/pybo/blob/master/LICENSE">Apache-2.0</a>' ], [ '<a href="https://github.com/kmike/pymorphy2/">pymorphy2</a>', '0.8', 'Mikhail Korobov', '<a href="https://github.com/kmike/pymorphy2/#pymorphy2">MIT</a>' ], [ '<a href="https://github.com/PyThaiNLP/pythainlp">PyThaiNLP</a>', '1.7.4', 'Wannaphong Phatthiyaphaibun (วรรณพงษ์ ภัททิยไพบูลย์)', '<a href="https://github.com/PyThaiNLP/pythainlp/blob/dev/LICENSE">Apache-2.0</a>' ], [ '<a href="https://github.com/alvations/sacremoses">SacreMoses</a>', '0.0.13', 'Liling Tan', '<a href="https://github.com/alvations/sacremoses#license">LGPL-2.1</a>' ], [ '<a href="https://spacy.io/">spaCy</a>', '2.1.3', 'Matthew Honnibal, Ines Montani', '<a href="https://github.com/explosion/spaCy/blob/master/LICENSE">MIT</a>' ], [ '<a href="https://github.com/undertheseanlp/underthesea">Underthesea</a>', '1.1.15', 'Vu Anh', '<a href="https://github.com/undertheseanlp/underthesea/blob/master/LICENSE">GPL-3.0</a>' ] ] self.ACKS_PLOTTING = [ [ '<a href="https://matplotlib.org/">Matplotlib</a>', '3.0.3', 'Matplotlib Development Team', '<a href="https://matplotlib.org/users/license.html">Matplotlib</a>' ], [ '<a href="https://amueller.github.io/word_cloud/">wordcloud</a>', '1.5.0', 'Andreas Christian Mueller', '<a href="https://github.com/amueller/word_cloud/blob/master/LICENSE">MIT</a>' ] ] self.ACKS_MISC = [ [ '<a href="https://www.crummy.com/software/BeautifulSoup/">Beautiful Soup</a>', '4.7.1', 'Leonard Richardson', '<a href="https://bazaar.launchpad.net/~leonardr/beautifulsoup/bs4/view/head:/LICENSE">MIT</a>' ], [ '<a href="https://github.com/PyYoshi/cChardet">cChardet</a>', '2.1.4', 'Yoshihiro Misawa', '<a href="https://github.com/PyYoshi/cChardet/blob/master/COPYING">MPL-1.0/GPL-2.0/LGPL-2.1</a>' ], [ '<a href="https://github.com/chardet/chardet">chardet</a>', '3.0.4', 'Daniel Blanchard', '<a href="https://github.com/chardet/chardet/blob/master/LICENSE">LGPL-2.1</a>' ], [ '<a href="https://github.com/Mimino666/langdetect">langdetect</a>', '1.0.7', 'Michal Mimino Danilak', '<a href="https://github.com/Mimino666/langdetect/blob/master/LICENSE">Apache-2.0</a>' ], [ '<a href="https://github.com/saffsd/langid.py">langid.py</a>', '1.1.6', 'Marco Lui', '<a href="https://github.com/saffsd/langid.py/blob/master/LICENSE">BSD-2-Clause</a>' ], [ '<a href="https://lxml.de/">lxml</a>', '4.3.3', 'Stefan Behnel', '<a href="https://github.com/lxml/lxml/blob/master/doc/licenses/BSD.txt">BSD-3-Clause</a>' ], [ '<a href="http://www.numpy.org/">NumPy</a>', '1.16.2', 'NumPy Developers', '<a href="http://www.numpy.org/license.html">BSD-3-Clause</a>' ], [ '<a href="https://openpyxl.readthedocs.io/en/stable/">openpyxl</a>', '2.6.1', 'Eric Gazoni, Charlie Clark', '<a href="https://bitbucket.org/openpyxl/openpyxl/src/5983d4ba5c18b85171185e8b1ca136876ec52864/LICENCE.rst">MIT</a>' ], [ '<a href="http://www.pyinstaller.org/">PyInstaller</a>', '3.5.dev0+cb8d10af6', 'Hartmut Goebel', '<a href="https://github.com/pyinstaller/pyinstaller/blob/develop/COPYING.txt">PyInstaller</a>' ], [ '<a href="https://github.com/python-openxml/python-docx">python-docx</a>', '0.8.10', 'Steve Canny', '<a href="https://github.com/python-openxml/python-docx/blob/master/LICENSE">MIT</a>' ], [ '<a href="http://python-requests.org">requests</a>', '2.21.0', 'Kenneth Reitz', '<a href="https://github.com/requests/requests/blob/master/LICENSE">Apache-2.0</a>' ], [ '<a href="https://www.scipy.org/">SciPy</a>', '1.2.1', 'SciPy Developers', '<a href="https://www.scipy.org/scipylib/license.html">BSD-3-Clause</a>' ], [ '<a href="https://github.com/python-excel/xlrd">xlrd</a>', '1.2.0', 'Stephen John Machin', '<a href="https://github.com/python-excel/xlrd/blob/master/LICENSE">BSD-3-Clause/BSD-4-Clause</a>' ] ] self.ACKS_DATA = [ [ '<a href="https://github.com/pharos-alexandria/grk-stoplist">grk-stoplist</a>', '/', 'Annette von Stockhausen', '<a href="https://github.com/pharos-alexandria/grk-stoplist/blob/master/LICENSE">CC0-1.0</a>' ], [ '<a href="https://github.com/stenskjaer/lemmalist-greek">lemmalist-greek</a>', '/', 'Michael Stenskjær Christensen', '<a href="https://github.com/stenskjaer/lemmalist-greek/blob/master/LICENSE">GPL-3.0</a>' ], [ '<a href="https://github.com/michmech/lemmatization-lists">Lemmatization Lists</a>', '/', 'Michal Boleslav Měchura', '<a href="https://github.com/michmech/lemmatization-lists/blob/master/LICENCE">ODbL</a>' ], [ '<a href="https://github.com/stopwords-iso/stopwords-iso">Stopwords ISO</a>', '0.4.0', 'Gene Diaz', '<a href="https://github.com/stopwords-iso/stopwords-iso/blob/master/LICENSE">MIT</a>' ] ] self.label_acks = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> Wordless stands on the shoulders of giants. Thus, I would like to extend my thanks to the following open-source projects: </div> '''), self) self.label_browse_category = QLabel(self.tr('Browse by Category:'), self) self.combo_box_browse_category = wordless_box.Wordless_Combo_Box(self) self.table_acks = wordless_table.Wordless_Table( self, headers=[ self.tr('Name'), self.tr('Version'), self.tr('Author(s)'), self.tr('License') ]) self.combo_box_browse_category.addItems([ self.tr('General'), self.tr('Natural Language Processing'), self.tr('Plotting'), self.tr('Miscellaneous'), self.tr('Data') ]) self.table_acks.setFixedHeight(250) self.combo_box_browse_category.currentTextChanged.connect( self.browse_category_changed) layout_browse_category = wordless_layout.Wordless_Layout() layout_browse_category.addWidget(self.label_browse_category, 0, 0) layout_browse_category.addWidget(self.combo_box_browse_category, 0, 1) layout_browse_category.setColumnStretch(2, 1) self.wrapper_info.layout().addWidget(self.label_acks, 0, 0) self.wrapper_info.layout().addLayout(layout_browse_category, 1, 0) self.wrapper_info.layout().addWidget(self.table_acks, 2, 0) self.load_settings() self.set_fixed_height()
def __init__(self, main, files_missing, files_empty, files_decoding_error, files_pos_tagging_not_supported): if files_pos_tagging_not_supported: super().__init__(main, main.tr('Error Loading Files'), width = DIALOG_ERROR_WIDTH, height = DIALOG_ERROR_HEIGHT_COLLIGATION) else: super().__init__(main, main.tr('Error Loading Files'), width = DIALOG_ERROR_WIDTH, height = DIALOG_ERROR_HEIGHT) if files_pos_tagging_not_supported: self.label_error = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> An error occurred while loading the following files. Please check the files and/or your settings and try again. </div> <div> The built-in POS taggers currently have no support for some of the following files, please check your language settings or provide files that have already been POS-tagged. </div> '''), self ) else: self.label_error = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> An error occurred while loading the following files. Please check the files and/or your settings and try again. </div> '''), self ) self.table_error_files = wordless_table.Wordless_Table_Error(self, headers = [ self.tr('Error Types'), self.tr('Files') ]) self.table_error_files.setFixedHeight(TABLE_ERROR_FILES_HEIGHT) self.table_error_files.setRowCount(0) self.button_export.clicked.connect(self.table_error_files.export_table) for file in files_missing: self.table_error_files.setRowCount(self.table_error_files.rowCount() + 1) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Missing File'))) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) for file in files_empty: self.table_error_files.setRowCount(self.table_error_files.rowCount() + 1) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Empty File'))) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) for file in files_decoding_error: self.table_error_files.setRowCount(self.table_error_files.rowCount() + 1) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('Decoding Error'))) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) for file in files_pos_tagging_not_supported: self.table_error_files.setRowCount(self.table_error_files.rowCount() + 1) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 0, QTableWidgetItem(self.tr('POS Tagging Not Supported'))) self.table_error_files.setItem(self.table_error_files.rowCount() - 1, 1, QTableWidgetItem(file)) self.wrapper_info.layout().addWidget(self.label_error, 0, 0) self.wrapper_info.layout().addWidget(self.table_error_files, 1, 0)
def __init__(self, main): super().__init__(main, main.tr('Donating'), width = 450) self.label_donating = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> If you would like to support the development of Wordless, you may donate via PayPal, Alipay or WeChat. </div> '''), self ) self.label_donating_via = QLabel(self.tr('Donating via:'), self) self.combo_box_donating_via = wordless_box.Wordless_Combo_Box(self) self.label_donating_via_img = wordless_label.Wordless_Label_Html('', self) self.label_donating_note = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> <span style="color: #F00;"><b>Important Note</b></span>: I <b>WILL NOT PROVIDE</b> invoices, receipts, refund services, detailed spending reports, my contact information other than email addresses, my personal social media accounts, private email/phone support, or guarantees on bug fixes, enhancements, new features, or new releases of Wordless for donation. </div> '''), self ) self.combo_box_donating_via.addItems([ self.tr('PayPal'), self.tr('Alipay'), self.tr('WeChat') ]) self.combo_box_donating_via.currentTextChanged.connect(self.donating_via_changed) layout_donating_via = wordless_layout.Wordless_Layout() layout_donating_via.addWidget(self.label_donating_via, 0, 0) layout_donating_via.addWidget(self.combo_box_donating_via, 0, 1) layout_donating_via.setColumnStretch(2, 1) self.wrapper_info.layout().addWidget(self.label_donating, 0, 0) self.wrapper_info.layout().addLayout(layout_donating_via, 1, 0) self.wrapper_info.layout().addWidget(self.label_donating_via_img, 2, 0, Qt.AlignHCenter | Qt.AlignVCenter) self.wrapper_info.layout().addWidget(self.label_donating_note, 3, 0) # Calculate height donating_via_old = self.main.settings_custom['menu']['help']['donating']['donating_via'] self.combo_box_donating_via.setCurrentText('PayPal') self.donating_via_changed() height_donating_via_paypal = self.label_donating_via_img.sizeHint().height() self.height_paypal = self.heightForWidth(self.width()) self.combo_box_donating_via.setCurrentText('Alipay') self.donating_via_changed() height_donating_via_alipay = self.label_donating_via_img.sizeHint().height() self.height_alipay = self.heightForWidth(self.width()) + (height_donating_via_alipay - height_donating_via_paypal) self.main.settings_custom['menu']['help']['donating']['donating_via'] = donating_via_old self.load_settings()
def __init__(self, main): super().__init__(main, main.tr('Acknowledgments'), width=550) self.ACKS_GENERAL = [ # Python [ 'Python', 'https://www.python.org', '3.7.5', 'Guido van Rossum', 'PSF', 'https://docs.python.org/3.7/license.html#psf-license-agreement-for-python-release' ], # PyInstaller [ 'PyInstaller', 'http://www.pyinstaller.org', '4.0.dev0+46286a1f4', 'Hartmut Goebel', 'PyInstaller', 'https://github.com/pyinstaller/pyinstaller/blob/develop/COPYING.txt' ], # PyQt [ 'PyQt', 'https://www.riverbankcomputing.com/software/pyqt/intro', '5.13.2', 'Riverbank Computing Limited', 'GPL-3.0', 'http://pyqt.sourceforge.net/Docs/PyQt5/introduction.html#license' ], # pytest [ 'pytest', 'https://pytest.org', '5.3.1', 'Holger Krekel', 'MIT', 'https://github.com/pytest-dev/pytest/blob/master/LICENSE' ] ] self.ACKS_NLP = [ # botok [ 'botok', 'https://github.com/Esukhia/botok', '0.6.18', 'Hélios Drupchen Hildt', 'Apache-2.0', 'https://github.com/Esukhia/botok/blob/master/LICENSE' ], # jieba [ 'jieba<br>(“结巴”中文分词)', 'https://github.com/fxsjy/jieba', '0.39', 'Sun Junyi (孙君意)', 'MIT', 'https://github.com/fxsjy/jieba/blob/master/LICENSE' ], # nagisa [ 'nagisa', 'https://github.com/taishi-i/nagisa', '0.2.4', 'Taishi Ikeda (池田大志)', 'MIT', 'https://github.com/taishi-i/nagisa/blob/master/LICENSE.txt' ], # NLTK [ 'NLTK', 'http://www.nltk.org', '3.4.5', 'Steven Bird, Liling Tan', 'Apache-2.0', 'https://github.com/nltk/nltk/blob/develop/LICENSE.txt' ], # pymorphy2 [ 'pymorphy2', 'https://github.com/kmike/pymorphy2', '0.8', 'Mikhail Korobov', 'MIT', 'https://github.com/kmike/pymorphy2/#pymorphy2' ], # PyThaiNLP [ 'PyThaiNLP', 'https://github.com/PyThaiNLP/pythainlp', '2.0.7', 'Wannaphong Phatthiyaphaibun<br>(วรรณพงษ์ ภัททิยไพบูลย์)', 'Apache-2.0', 'https://github.com/PyThaiNLP/pythainlp/blob/dev/LICENSE' ], # razdel [ 'razdel', 'https://github.com/natasha/razdel', '0.4.0', 'Alexander Kukushkin', 'MIT', 'https://github.com/natasha/razdel#%D0%BB%D0%B8%D1%86%D0%B5%D0%BD%D0%B7%D0%B8%D1%8F' ], # Sacremoses [ 'Sacremoses', 'https://github.com/alvations/sacremoses', '0.0.35', 'Liling Tan', 'LGPL-2.1', 'https://github.com/alvations/sacremoses#license' ], # spaCy [ 'spaCy', 'https://spacy.io', '2.2.3', 'Matthew Honnibal, Ines Montani', 'MIT', 'https://github.com/explosion/spaCy/blob/master/LICENSE' ], # syntok [ 'syntok', 'https://github.com/fnl/syntok', '1.2.2', 'Florian Leitner', 'MIT', 'https://github.com/fnl/syntok/blob/master/LICENSE' ], # Underthesea [ 'Underthesea', 'https://github.com/undertheseanlp/underthesea', '1.1.17', 'Vu Anh', 'GPL-3.0', 'https://github.com/undertheseanlp/underthesea/blob/master/LICENSE' ] ] self.ACKS_LANG_DATA = [ # extra-stopwords [ 'extra-stopwords', 'https://github.com/Xangis/extra-stopwords', 'N/A', 'Jason Champion', 'MIT', 'https://github.com/Xangis/extra-stopwords/blob/master/LICENSE' ], # grk-stoplist [ 'grk-stoplist', 'https://github.com/pharos-alexandria/grk-stoplist', 'N/A', 'Annette von Stockhausen', 'CC0-1.0', 'https://github.com/pharos-alexandria/grk-stoplist/blob/master/LICENSE' ], # lemmalist-greek [ 'lemmalist-greek', 'https://github.com/stenskjaer/lemmalist-greek', 'N/A', 'Michael Stenskjær Christensen', 'GPL-3.0', 'https://github.com/stenskjaer/lemmalist-greek/blob/master/LICENSE' ], # Lemmatization Lists [ 'Lemmatization Lists', 'https://github.com/michmech/lemmatization-lists', 'N/A', 'Michal Boleslav Měchura', 'ODbL', 'https://github.com/michmech/lemmatization-lists/blob/master/LICENCE' ], # Stopwords ISO [ 'Stopwords ISO', 'https://github.com/stopwords-iso/stopwords-iso', '0.4.0', 'Gene Diaz', 'MIT', 'https://github.com/stopwords-iso/stopwords-iso/blob/master/LICENSE' ] ] self.ACKS_PLOTTING = [ # Matplotlib [ 'Matplotlib', 'https://matplotlib.org', '3.1.2', 'Matplotlib Development Team', 'Matplotlib', 'https://matplotlib.org/users/license.html' ], # NetworkX [ 'NetworkX', 'http://networkx.github.io', '2.4', 'Aric Hagberg, Dan Schult, Pieter Swart', 'BSD-3-Clause', 'https://github.com/networkx/networkx/blob/master/LICENSE.txt' ], # WordCloud [ 'WordCloud', 'https://amueller.github.io/word_cloud/', '1.6.0', 'Andreas Christian Mueller', 'MIT', 'https://github.com/amueller/word_cloud/blob/master/LICENSE' ] ] self.ACKS_MISC = [ # Beautiful Soup [ 'Beautiful Soup', 'https://www.crummy.com/software/BeautifulSoup/', '4.8.1', 'Leonard Richardson', 'MIT', 'https://bazaar.launchpad.net/~leonardr/beautifulsoup/bs4/view/head:/LICENSE' ], # cChardet [ 'cChardet', 'https://github.com/PyYoshi/cChardet', '2.1.5', 'Yoshihiro Misawa', 'MPL-1.0/GPL-2.0/LGPL-2.1', 'https://github.com/PyYoshi/cChardet/blob/master/COPYING' ], # chardet [ 'chardet', 'https://github.com/chardet/chardet', '3.0.4', 'Daniel Blanchard', 'LGPL-2.1', 'https://github.com/chardet/chardet/blob/master/LICENSE' ], # langdetect [ 'langdetect', 'https://github.com/Mimino666/langdetect', '1.0.7', 'Michal Mimino Danilak', 'Apache-2.0', 'https://github.com/Mimino666/langdetect/blob/master/LICENSE' ], # langid.py [ 'langid.py', 'https://github.com/saffsd/langid.py', '1.1.6', 'Marco Lui', 'BSD-2-Clause', 'https://github.com/saffsd/langid.py/blob/master/LICENSE' ], # lxml [ 'lxml', 'https://lxml.de', '4.4.2', 'Stefan Behnel', 'BSD-3-Clause', 'https://github.com/lxml/lxml/blob/master/doc/licenses/BSD.txt' ], # NumPy [ 'NumPy', 'https://numpy.org', '1.17.4', 'NumPy Developers', 'BSD-3-Clause', 'http://www.numpy.org/license.html' ], # openpyxl [ 'openpyxl', 'https://openpyxl.readthedocs.io/en/stable/', '3.0.2', 'Eric Gazoni, Charlie Clark', 'MIT', 'https://bitbucket.org/openpyxl/openpyxl/src/5983d4ba5c18b85171185e8b1ca136876ec52864/LICENCE.rst' ], # python-docx [ 'python-docx', 'https://github.com/python-openxml/python-docx', '0.8.10', 'Steve Canny', 'MIT', 'https://github.com/python-openxml/python-docx/blob/master/LICENSE' ], # requests [ 'requests', 'https://python-requests.org', '2.22.0', 'Kenneth Reitz', 'Apache-2.0', 'https://github.com/requests/requests/blob/master/LICENSE' ], # SciPy [ 'SciPy', 'https://www.scipy.org', '1.3.3', 'SciPy Developers', 'BSD-3-Clause', 'https://www.scipy.org/scipylib/license.html' ], # xlrd [ 'xlrd', 'https://github.com/python-excel/xlrd', '1.2.0', 'Stephen John Machin', 'BSD-3-Clause/BSD-4-Clause', 'https://github.com/python-excel/xlrd/blob/master/LICENSE' ] ] self.label_acks = wordless_label.Wordless_Label_Dialog( self.tr(''' <div> I would like to extend my sincere gratitude to the following open-source projects without which this project would not have been possible: </div> '''), self) self.label_browse_category = QLabel(self.tr('Browse by category:'), self) self.combo_box_browse_category = wordless_box.Wordless_Combo_Box(self) self.table_acks = wordless_table.Wordless_Table( self, headers=[ self.tr('Name'), self.tr('Version'), self.tr('Author(s)'), self.tr('License') ]) self.combo_box_browse_category.addItems([ self.tr('General'), self.tr('Natural Language Processing'), self.tr('Language Data'), self.tr('Plotting'), self.tr('Miscellaneous') ]) self.table_acks.setFixedHeight(250) self.combo_box_browse_category.currentTextChanged.connect( self.browse_category_changed) layout_browse_category = wordless_layout.Wordless_Layout() layout_browse_category.addWidget(self.label_browse_category, 0, 0) layout_browse_category.addWidget(self.combo_box_browse_category, 0, 1) layout_browse_category.setColumnStretch(2, 1) self.wrapper_info.layout().addWidget(self.label_acks, 0, 0) self.wrapper_info.layout().addLayout(layout_browse_category, 1, 0) self.wrapper_info.layout().addWidget(self.table_acks, 2, 0) self.load_settings() self.set_fixed_height()