def createEditor(self, parent, option, index): if self.is_editable(index): combo_box = wl_boxes.Wl_Combo_Box(parent) combo_box.addItems(self.items) combo_box.setEditable(self.editable) if not self.enabled: combo_box.setEnabled(False) return combo_box
def __init__(self, main): super().__init__(main) self.settings_default = self.main.settings_default['figs'] self.settings_custom = self.main.settings_custom['figs'] # Line Chart group_box_figs_line_chart = QGroupBox(self.tr('Line Chart'), self) self.label_figs_line_chart_font = QLabel(self.tr('Font:'), self) self.combo_box_figs_line_chart_font = wl_boxes.Wl_Combo_Box_Font_Family( self) group_box_figs_line_chart.setLayout(wl_layouts.Wl_Layout()) group_box_figs_line_chart.layout().addWidget( self.label_figs_line_chart_font, 0, 0) group_box_figs_line_chart.layout().addWidget( self.combo_box_figs_line_chart_font, 0, 1) group_box_figs_line_chart.layout().setColumnStretch(2, 1) # Word Cloud group_box_figs_word_cloud = QGroupBox(self.tr('Word Cloud'), self) self.label_figs_word_cloud_font = QLabel(self.tr('Font:'), self) self.combo_box_figs_word_cloud_font = wl_boxes.Wl_Combo_Box(self) self.label_figs_word_cloud_bg_color = QLabel( self.tr('Background Color:'), self) (self.label_figs_word_cloud_bg_color_pick, self.button_figs_word_cloud_bg_color_pick ) = wl_widgets.wl_widgets_pick_color(self) self.combo_box_figs_word_cloud_font.addItems( ['DroidSansMono', 'Code2000', 'Unifont']) group_box_figs_word_cloud.setLayout(wl_layouts.Wl_Layout()) group_box_figs_word_cloud.layout().addWidget( self.label_figs_word_cloud_font, 0, 0) group_box_figs_word_cloud.layout().addWidget( self.combo_box_figs_word_cloud_font, 0, 1, 1, 2) group_box_figs_word_cloud.layout().addWidget( self.label_figs_word_cloud_bg_color, 1, 0) group_box_figs_word_cloud.layout().addWidget( self.label_figs_word_cloud_bg_color_pick, 1, 1) group_box_figs_word_cloud.layout().addWidget( self.button_figs_word_cloud_bg_color_pick, 1, 2) group_box_figs_word_cloud.layout().setColumnStretch(3, 1) # Network Graph group_box_figs_network_graph = QGroupBox(self.tr('Network Graph'), self) self.label_figs_network_graph_layout = QLabel(self.tr('Layout:'), self) self.combo_box_figs_network_graph_layout = wl_boxes.Wl_Combo_Box(self) self.label_figs_network_graph_node_font = QLabel( self.tr('Node Font:'), self) self.combo_box_figs_network_graph_node_font = wl_boxes.Wl_Combo_Box_Font_Family( self) self.label_figs_network_graph_node_font_size = QLabel( self.tr('Node Font Size:'), self) self.spin_box_figs_network_graph_node_font_size = wl_boxes.Wl_Spin_Box_Font_Size( self) self.label_figs_network_graph_edge_font = QLabel( self.tr('Edge Font:'), self) self.combo_box_figs_network_graph_edge_font = wl_boxes.Wl_Combo_Box_Font_Family( self) self.label_figs_network_graph_edge_font_size = QLabel( self.tr('Edge Font Size:'), self) self.spin_box_figs_network_graph_edge_font_size = wl_boxes.Wl_Spin_Box_Font_Size( self) self.label_figs_network_graph_edge_color = QLabel( self.tr('Edge Color:'), self) (self.label_figs_network_graph_edge_color_pick, self.combo_box_figs_network_graph_color_pick ) = wl_widgets.wl_widgets_pick_color(self) self.combo_box_figs_network_graph_layout.addItems([ self.tr('Circular'), self.tr('Kamada-Kawai'), self.tr('Planar'), self.tr('Random'), self.tr('Shell'), self.tr('Spring'), self.tr('Spectral') ]) group_box_figs_network_graph.setLayout(wl_layouts.Wl_Layout()) group_box_figs_network_graph.layout().addWidget( self.label_figs_network_graph_layout, 0, 0) group_box_figs_network_graph.layout().addWidget( self.combo_box_figs_network_graph_layout, 0, 1, 1, 2) group_box_figs_network_graph.layout().addWidget( self.label_figs_network_graph_node_font, 1, 0) group_box_figs_network_graph.layout().addWidget( self.combo_box_figs_network_graph_node_font, 1, 1, 1, 2) group_box_figs_network_graph.layout().addWidget( self.label_figs_network_graph_node_font_size, 2, 0) group_box_figs_network_graph.layout().addWidget( self.spin_box_figs_network_graph_node_font_size, 2, 1, 1, 2) group_box_figs_network_graph.layout().addWidget( self.label_figs_network_graph_edge_font, 3, 0) group_box_figs_network_graph.layout().addWidget( self.combo_box_figs_network_graph_edge_font, 3, 1, 1, 2) group_box_figs_network_graph.layout().addWidget( self.label_figs_network_graph_edge_font_size, 4, 0) group_box_figs_network_graph.layout().addWidget( self.spin_box_figs_network_graph_edge_font_size, 4, 1, 1, 2) group_box_figs_network_graph.layout().addWidget( self.label_figs_network_graph_edge_color, 5, 0) group_box_figs_network_graph.layout().addWidget( self.label_figs_network_graph_edge_color_pick, 5, 1) group_box_figs_network_graph.layout().addWidget( self.combo_box_figs_network_graph_color_pick, 5, 2) group_box_figs_network_graph.layout().setColumnStretch(3, 1) self.setLayout(wl_layouts.Wl_Layout()) self.layout().addWidget(group_box_figs_line_chart, 0, 0) self.layout().addWidget(group_box_figs_word_cloud, 1, 0) self.layout().addWidget(group_box_figs_network_graph, 2, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(3, 1)
def __init__(self, main): super().__init__(main) self.settings_default = self.main.settings_default['exp'] self.settings_custom = self.main.settings_custom['exp'] # Tables group_box_exp_tables = QGroupBox(self.tr('Tables'), self) self.label_exp_tables_default_path = QLabel(self.tr('Default Path:'), self) self.line_edit_exp_tables_default_path = QLineEdit(self) self.button_exp_tables_default_path = QPushButton(self.tr('Browse...'), self) self.label_exp_tables_default_type = QLabel(self.tr('Default Type:'), self) self.combo_box_exp_tables_default_type = wl_boxes.Wl_Combo_Box(self) self.label_exp_tables_default_encoding = QLabel(self.tr('Default Encoding:'), self) self.combo_box_exp_tables_default_encoding = wl_boxes.Wl_Combo_Box_Encoding(self.main) self.combo_box_exp_tables_default_type.addItems(self.main.settings_global['file_types']['exp_tables']) self.button_exp_tables_default_path.clicked.connect(self.browse_tables) self.combo_box_exp_tables_default_type.currentTextChanged.connect(self.tables_default_type_changed) group_box_exp_tables.setLayout(wl_layouts.Wl_Layout()) group_box_exp_tables.layout().addWidget(self.label_exp_tables_default_path, 0, 0) group_box_exp_tables.layout().addWidget(self.line_edit_exp_tables_default_path, 0, 1) group_box_exp_tables.layout().addWidget(self.button_exp_tables_default_path, 0, 2) group_box_exp_tables.layout().addWidget(self.label_exp_tables_default_type, 1, 0) group_box_exp_tables.layout().addWidget(self.combo_box_exp_tables_default_type, 1, 1, 1, 2) group_box_exp_tables.layout().addWidget(self.label_exp_tables_default_encoding, 2, 0) group_box_exp_tables.layout().addWidget(self.combo_box_exp_tables_default_encoding, 2, 1, 1 ,2) # Search Terms group_box_exp_search_terms = QGroupBox(self.tr('Search Terms'), self) self.label_exp_search_terms_default_path = QLabel(self.tr('Default Path:'), self) self.line_edit_exp_search_terms_default_path = QLineEdit(self) self.button_exp_search_terms_default_path = QPushButton(self.tr('Browse...'), self) self.label_exp_search_terms_default_encoding = QLabel(self.tr('Default Encoding:'), self) self.combo_box_exp_search_terms_default_encoding = wl_boxes.Wl_Combo_Box_Encoding(self) self.button_exp_search_terms_default_path.clicked.connect(self.browse_search_terms) group_box_exp_search_terms.setLayout(wl_layouts.Wl_Layout()) group_box_exp_search_terms.layout().addWidget(self.label_exp_search_terms_default_path, 0, 0) group_box_exp_search_terms.layout().addWidget(self.line_edit_exp_search_terms_default_path, 0, 1) group_box_exp_search_terms.layout().addWidget(self.button_exp_search_terms_default_path, 0, 2) group_box_exp_search_terms.layout().addWidget(self.label_exp_search_terms_default_encoding, 1, 0) group_box_exp_search_terms.layout().addWidget(self.combo_box_exp_search_terms_default_encoding, 1, 1, 1, 2) # Stop Words group_box_exp_stop_words = QGroupBox(self.tr('Stop Words'), self) self.label_exp_stop_words_default_path = QLabel(self.tr('Default Path:'), self) self.line_edit_exp_stop_words_default_path = QLineEdit(self) self.button_exp_stop_words_default_path = QPushButton(self.tr('Browse...'), self) self.label_exp_stop_words_default_encoding = QLabel(self.tr('Default Encoding:'), self) self.combo_box_exp_stop_words_default_encoding = wl_boxes.Wl_Combo_Box_Encoding(self) self.button_exp_stop_words_default_path.clicked.connect(self.browse_stop_words) group_box_exp_stop_words.setLayout(wl_layouts.Wl_Layout()) group_box_exp_stop_words.layout().addWidget(self.label_exp_stop_words_default_path, 0, 0) group_box_exp_stop_words.layout().addWidget(self.line_edit_exp_stop_words_default_path, 0, 1) group_box_exp_stop_words.layout().addWidget(self.button_exp_stop_words_default_path, 0, 2) group_box_exp_stop_words.layout().addWidget(self.label_exp_stop_words_default_encoding, 1, 0) group_box_exp_stop_words.layout().addWidget(self.combo_box_exp_stop_words_default_encoding, 1, 1, 1, 2) self.setLayout(wl_layouts.Wl_Layout()) self.layout().addWidget(group_box_exp_tables, 0, 0) self.layout().addWidget(group_box_exp_search_terms, 1, 0) self.layout().addWidget(group_box_exp_stop_words, 2, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(3, 1) self.tables_default_type_changed()
def __init__(self, main): super().__init__(main) self.settings_global = self.main.settings_global['pos_taggers'] self.settings_default = self.main.settings_default['pos_tagging'] self.settings_custom = self.main.settings_custom['pos_tagging'] # POS Tagger Settings group_box_pos_tagger_settings = QGroupBox( self.tr('POS Tagger Settings'), self) self.table_pos_taggers = wl_tables.Wl_Table( self, headers=[self.tr('Language'), self.tr('POS Taggers')], editable=True) self.checkbox_to_universal_pos_tags = QCheckBox( self.tr('Convert all POS tags to universal POS tags')) self.table_pos_taggers.verticalHeader().setHidden(True) self.table_pos_taggers.model().setRowCount(len(self.settings_global)) self.table_pos_taggers.disable_updates() for i, lang in enumerate(self.settings_global): self.table_pos_taggers.model().setItem( i, 0, QStandardItem(wl_conversion.to_lang_text(self.main, lang))) self.table_pos_taggers.model().setItem(i, 1, QStandardItem()) self.table_pos_taggers.setItemDelegateForRow( i, wl_item_delegates.Wl_Item_Delegate_Combo_Box( parent=self.table_pos_taggers, items=list( wl_nlp_utils.to_lang_util_texts( self.main, util_type='pos_taggers', util_codes=self.settings_global[lang])), col=1)) self.table_pos_taggers.enable_updates() group_box_pos_tagger_settings.setLayout(wl_layouts.Wl_Layout()) group_box_pos_tagger_settings.layout().addWidget( self.table_pos_taggers, 0, 0) group_box_pos_tagger_settings.layout().addWidget( self.checkbox_to_universal_pos_tags, 1, 0) # Preview group_box_preview = QGroupBox(self.tr('Preview'), self) self.label_pos_tagging_preview_lang = QLabel( self.tr('Select language:'), self) self.combo_box_pos_tagging_preview_lang = wl_boxes.Wl_Combo_Box(self) self.button_pos_tagging_show_preview = QPushButton( self.tr('Show preview'), self) self.text_edit_pos_tagging_preview_samples = QTextEdit(self) self.text_edit_pos_tagging_preview_results = QTextEdit(self) self.combo_box_pos_tagging_preview_lang.addItems( wl_conversion.to_lang_texts(self.main, self.settings_global)) self.button_pos_tagging_show_preview.setFixedWidth(150) self.text_edit_pos_tagging_preview_samples.setAcceptRichText(False) self.text_edit_pos_tagging_preview_results.setReadOnly(True) self.combo_box_pos_tagging_preview_lang.currentTextChanged.connect( self.preview_changed) self.button_pos_tagging_show_preview.clicked.connect( self.preview_results_changed) self.text_edit_pos_tagging_preview_samples.textChanged.connect( self.preview_changed) self.text_edit_pos_tagging_preview_results.textChanged.connect( self.preview_changed) layout_preview_settings = wl_layouts.Wl_Layout() layout_preview_settings.addWidget(self.label_pos_tagging_preview_lang, 0, 0) layout_preview_settings.addWidget( self.combo_box_pos_tagging_preview_lang, 0, 1) layout_preview_settings.addWidget(self.button_pos_tagging_show_preview, 0, 3) layout_preview_settings.setColumnStretch(2, 1) group_box_preview.setLayout(wl_layouts.Wl_Layout()) group_box_preview.layout().addLayout(layout_preview_settings, 0, 0, 1, 2) group_box_preview.layout().addWidget( self.text_edit_pos_tagging_preview_samples, 1, 0) group_box_preview.layout().addWidget( self.text_edit_pos_tagging_preview_results, 1, 1) self.setLayout(wl_layouts.Wl_Layout()) self.layout().addWidget(group_box_pos_tagger_settings, 0, 0) self.layout().addWidget(group_box_preview, 1, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(0, 3) self.layout().setRowStretch(1, 2)
def __init__(self, main): super().__init__(main) self.settings_global = self.main.settings_global['pos_taggers'] self.settings_default = self.main.settings_default['tagsets'] self.settings_custom = self.main.settings_custom['tagsets'] self.pos_tag_mappings_loaded = False self.settings_tagsets = QWidget(self) # Preview Settings group_box_preview_settings = QGroupBox(self.tr('Preview Settings:'), self) self.label_tagsets_lang = QLabel(self.tr('Language:'), self) self.combo_box_tagsets_lang = wl_boxes.Wl_Combo_Box(self) self.label_tagsets_pos_tagger = QLabel(self.tr('POS Tagger:'), self) self.combo_box_tagsets_pos_tagger = wl_boxes.Wl_Combo_Box_Adjustable( self) self.combo_box_tagsets_lang.addItems( wl_conversion.to_lang_texts(self.main, self.settings_global)) self.combo_box_tagsets_lang.currentTextChanged.connect( self.preview_lang_changed) self.combo_box_tagsets_pos_tagger.currentTextChanged.connect( self.preview_pos_tagger_changed) group_box_preview_settings.setLayout(wl_layouts.Wl_Layout()) group_box_preview_settings.layout().addWidget(self.label_tagsets_lang, 0, 0) group_box_preview_settings.layout().addWidget( self.combo_box_tagsets_lang, 0, 1, Qt.AlignLeft) group_box_preview_settings.layout().addWidget( self.label_tagsets_pos_tagger, 1, 0) group_box_preview_settings.layout().addWidget( self.combo_box_tagsets_pos_tagger, 1, 1, Qt.AlignLeft) group_box_preview_settings.layout().setColumnStretch(2, 1) # Mapping Settings group_box_mapping_settings = QGroupBox(self.tr('Mapping Settings')) self.stacked_widget_num_pos_tags = wl_layouts.Wl_Stacked_Widget(self) self.label_tagsets_num_pos_tags = QLabel('', self) self.label_tagsets_uneditable = wl_labels.Wl_Label_Hint( self.tr('* This POS tagger does not support custom mappings.'), self) self.button_tagsets_reset = QPushButton(self.tr('Reset'), self) self.button_tagsets_reset_all = QPushButton(self.tr('Reset All'), self) self.table_mappings = wl_tables.Wl_Table( self, headers=[ self.tr('POS Tag'), self.tr('Universal POS Tag'), self.tr('Description'), self.tr('Examples') ], editable=True) self.stacked_widget_num_pos_tags.addWidget( self.label_tagsets_num_pos_tags) self.stacked_widget_num_pos_tags.addWidget( self.label_tagsets_uneditable) self.table_mappings.setItemDelegate( wl_item_delegates.Wl_Item_Delegate_Combo_Box( parent=self.table_mappings, items=[ 'ADJ', 'ADP', 'ADV', 'AUX', 'CONJ', # Coordinating/Subordinating conjunctions 'CCONJ', 'SCONJ', 'DET', 'INTJ', 'NOUN', 'PROPN', 'NUM', 'PART', 'PRON', 'VERB', 'PUNCT', 'SYM', 'X' ], col=1, editable=True)) self.button_tagsets_reset.setFixedWidth(120) self.button_tagsets_reset_all.setFixedWidth(120) self.button_tagsets_reset.clicked.connect(self.reset_mappings) self.button_tagsets_reset_all.clicked.connect(self.reset_all_mappings) group_box_mapping_settings.setLayout(wl_layouts.Wl_Layout()) group_box_mapping_settings.layout().addWidget( self.stacked_widget_num_pos_tags, 0, 0) group_box_mapping_settings.layout().addWidget( self.button_tagsets_reset, 0, 2) group_box_mapping_settings.layout().addWidget( self.button_tagsets_reset_all, 0, 3) group_box_mapping_settings.layout().addWidget(self.table_mappings, 1, 0, 1, 4) group_box_mapping_settings.layout().setRowStretch(1, 1) group_box_mapping_settings.layout().setColumnStretch(1, 1) self.setLayout(wl_layouts.Wl_Layout()) self.layout().addWidget(group_box_preview_settings, 0, 0) self.layout().addWidget(group_box_mapping_settings, 1, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(1, 1)
def __init__(self, main): super().__init__(main) self.settings_global = self.main.settings_global['stop_word_lists'] self.settings_default = self.main.settings_default['stop_word_lists'] self.settings_custom = self.main.settings_custom['stop_word_lists'] # Stop Word Lists Settings group_box_stop_word_lists_settings = QGroupBox( self.tr('Stop Word Lists Settings'), self) self.table_stop_word_lists = wl_tables.Wl_Table( self, headers=[self.tr('Language'), self.tr('Stop Word List')], editable=True) self.table_stop_word_lists.verticalHeader().setHidden(True) self.table_stop_word_lists.model().setRowCount( len(self.settings_global)) self.table_stop_word_lists.disable_updates() for i, lang in enumerate(self.settings_global): self.table_stop_word_lists.model().setItem( i, 0, QStandardItem(wl_conversion.to_lang_text(self.main, lang))) self.table_stop_word_lists.model().setItem(i, 1, QStandardItem()) self.table_stop_word_lists.setItemDelegateForRow( i, wl_item_delegates.Wl_Item_Delegate_Combo_Box( parent=self.table_stop_word_lists, items=list( wl_nlp_utils.to_lang_util_texts( self.main, util_type='stop_word_lists', util_codes=self.settings_global[lang])), col=1)) self.table_stop_word_lists.enable_updates() self.table_stop_word_lists.model().dataChanged.connect( self.stop_word_list_changed) group_box_stop_word_lists_settings.setLayout(wl_layouts.Wl_Layout()) group_box_stop_word_lists_settings.layout().addWidget( self.table_stop_word_lists, 0, 0) # Preview group_box_preview = QGroupBox(self.tr('Preview'), self) self.label_stop_word_list_preview_lang = QLabel( self.tr('Select language:'), self) self.combo_box_stop_word_list_preview_lang = wl_boxes.Wl_Combo_Box( self) self.combo_box_stop_word_list_preview_lang.addItems( wl_conversion.to_lang_texts(self.main, self.settings_global)) self.label_stop_word_list_preview_count = QLabel('', self) self.list_stop_word_list_preview_results = wl_lists.Wl_List_Stop_Words( self) self.combo_box_stop_word_list_preview_lang.currentTextChanged.connect( self.preview_settings_changed) self.combo_box_stop_word_list_preview_lang.currentTextChanged.connect( self.preview_results_changed) layout_preview_settings = wl_layouts.Wl_Layout() layout_preview_settings.addWidget( self.label_stop_word_list_preview_lang, 0, 0) layout_preview_settings.addWidget( self.combo_box_stop_word_list_preview_lang, 0, 1) layout_preview_settings.addWidget( self.label_stop_word_list_preview_count, 0, 3) layout_preview_settings.setColumnStretch(2, 1) group_box_preview.setLayout(wl_layouts.Wl_Layout()) group_box_preview.layout().addLayout(layout_preview_settings, 0, 0, 1, 6) group_box_preview.layout().addWidget( self.list_stop_word_list_preview_results, 1, 0, 1, 6) group_box_preview.layout().addWidget( self.list_stop_word_list_preview_results.button_add, 2, 0) group_box_preview.layout().addWidget( self.list_stop_word_list_preview_results.button_ins, 2, 1) group_box_preview.layout().addWidget( self.list_stop_word_list_preview_results.button_del, 2, 2) group_box_preview.layout().addWidget( self.list_stop_word_list_preview_results.button_clr, 2, 3) group_box_preview.layout().addWidget( self.list_stop_word_list_preview_results.button_imp, 2, 4) group_box_preview.layout().addWidget( self.list_stop_word_list_preview_results.button_exp, 2, 5) self.setLayout(wl_layouts.Wl_Layout()) self.layout().addWidget(group_box_stop_word_lists_settings, 0, 0) self.layout().addWidget(group_box_preview, 1, 0) self.layout().setContentsMargins(6, 4, 6, 4) self.layout().setRowStretch(0, 3) self.layout().setRowStretch(1, 2) self.load_settings() self.preview_results_changed()
def __init__(self, main): super().__init__(main) self.table_concordancer_parallel_upper = Wl_Table_Concordancer_Parallel_Upper( self) self.table_concordancer_parallel_lower = Wl_Table_Concordancer_Parallel_Lower( self) self.table_concordancer_parallel_upper.add_tables( [self.table_concordancer_parallel_lower]) self.table_concordancer_parallel_upper.verticalScrollBar( ).valueChanged.connect(self.table_concordancer_parallel_lower. verticalScrollBar().setValue) self.table_concordancer_parallel_lower.verticalScrollBar( ).valueChanged.connect(self.table_concordancer_parallel_upper. verticalScrollBar().setValue) self.table_concordancer_parallel_lower.add_linked_table( self.table_concordancer_parallel_upper) layout_results = wl_layouts.Wl_Layout() layout_results.addWidget( self.table_concordancer_parallel_upper.label_number_results, 0, 0) layout_results.addWidget( self.table_concordancer_parallel_upper.button_results_sort, 0, 3) layout_results.addWidget( self.table_concordancer_parallel_upper.button_results_search, 0, 4) layout_results.setColumnStretch(1, 1) self.wrapper_table.layout().addLayout(layout_results, 0, 0, 1, 5) self.wrapper_table.layout().addWidget( self.table_concordancer_parallel_upper, 1, 0, 1, 5) self.wrapper_table.layout().addWidget( self.table_concordancer_parallel_lower, 2, 0, 1, 5) self.wrapper_table.layout().addWidget( self.table_concordancer_parallel_lower.button_generate_table, 3, 0) self.wrapper_table.layout().addWidget( self.table_concordancer_parallel_lower.button_generate_fig, 3, 1) self.wrapper_table.layout().addWidget( self.table_concordancer_parallel_lower.button_exp_selected, 3, 2) self.wrapper_table.layout().addWidget( self.table_concordancer_parallel_lower.button_exp_all, 3, 3) self.wrapper_table.layout().addWidget( self.table_concordancer_parallel_lower.button_clr, 3, 4) # Token Settings self.group_box_token_settings = QGroupBox(self.tr('Token Settings'), self) (self.checkbox_puncs, self.token_checkbox_ignore_tags, self.checkbox_use_tags ) = wl_widgets.wl_widgets_token_settings_concordancer(self) self.checkbox_puncs.stateChanged.connect(self.token_settings_changed) self.token_checkbox_ignore_tags.stateChanged.connect( self.token_settings_changed) self.checkbox_use_tags.stateChanged.connect( self.token_settings_changed) self.group_box_token_settings.setLayout(wl_layouts.Wl_Layout()) self.group_box_token_settings.layout().addWidget( self.checkbox_puncs, 0, 0, 1, 2) self.group_box_token_settings.layout().addWidget( wl_layouts.Wl_Separator(self), 1, 0, 1, 2) self.group_box_token_settings.layout().addWidget( self.token_checkbox_ignore_tags, 2, 0) self.group_box_token_settings.layout().addWidget( self.checkbox_use_tags, 2, 1) # Search Settings self.group_box_search_settings = QGroupBox(self.tr('Search Settings'), self) (self.label_search_term, self.checkbox_multi_search_mode, self.stacked_widget_search_term, self.line_edit_search_term, self.list_search_terms, self.label_separator, self.checkbox_ignore_case, self.checkbox_match_inflected_forms, self.checkbox_match_whole_words, self.checkbox_use_regex, self.search_checkbox_ignore_tags, self.checkbox_match_tags) = wl_widgets.wl_widgets_search_settings( self, tab='concordancer_parallel') (self.label_context_settings, self.button_context_settings ) = wl_widgets.wl_widgets_context_settings( self, tab='concordancer_parallel') self.checkbox_multi_search_mode.stateChanged.connect( self.search_settings_changed) self.line_edit_search_term.textChanged.connect( self.search_settings_changed) self.line_edit_search_term.returnPressed.connect( self.table_concordancer_parallel_lower.button_generate_table.click) self.list_search_terms.model().dataChanged.connect( self.search_settings_changed) self.checkbox_ignore_case.stateChanged.connect( self.search_settings_changed) self.checkbox_match_inflected_forms.stateChanged.connect( self.search_settings_changed) self.checkbox_match_whole_words.stateChanged.connect( self.search_settings_changed) self.checkbox_use_regex.stateChanged.connect( self.search_settings_changed) self.search_checkbox_ignore_tags.stateChanged.connect( self.search_settings_changed) self.checkbox_match_tags.stateChanged.connect( self.search_settings_changed) layout_context_settings = wl_layouts.Wl_Layout() layout_context_settings.addWidget(self.label_context_settings, 0, 0) layout_context_settings.addWidget(self.button_context_settings, 0, 1) layout_context_settings.setColumnStretch(1, 1) self.group_box_search_settings.setLayout(wl_layouts.Wl_Layout()) self.group_box_search_settings.layout().addWidget( self.label_search_term, 0, 0) self.group_box_search_settings.layout().addWidget( self.checkbox_multi_search_mode, 0, 1, Qt.AlignRight) self.group_box_search_settings.layout().addWidget( self.stacked_widget_search_term, 1, 0, 1, 2) self.group_box_search_settings.layout().addWidget( self.label_separator, 2, 0, 1, 2) self.group_box_search_settings.layout().addWidget( self.checkbox_ignore_case, 3, 0, 1, 2) self.group_box_search_settings.layout().addWidget( self.checkbox_match_inflected_forms, 4, 0, 1, 2) self.group_box_search_settings.layout().addWidget( self.checkbox_match_whole_words, 5, 0, 1, 2) self.group_box_search_settings.layout().addWidget( self.checkbox_use_regex, 6, 0, 1, 2) self.group_box_search_settings.layout().addWidget( self.search_checkbox_ignore_tags, 7, 0, 1, 2) self.group_box_search_settings.layout().addWidget( self.checkbox_match_tags, 8, 0, 1, 2) self.group_box_search_settings.layout().addWidget( wl_layouts.Wl_Separator(self), 9, 0, 1, 2) self.group_box_search_settings.layout().addLayout( layout_context_settings, 10, 0, 1, 2) # Generation Settings self.group_box_generation_settings = QGroupBox( self.tr('Generation Settings'), self) self.label_src_file = QLabel(self.tr('Source File:'), self) self.combo_box_src_file = Wl_Combo_Box_File_Concordancer(self) self.label_tgt_file = QLabel(self.tr('Target File:'), self) self.combo_box_tgt_file = Wl_Combo_Box_File_Concordancer(self) self.combo_box_src_file.currentTextChanged.connect( self.generation_settings_changed) self.combo_box_tgt_file.currentTextChanged.connect( self.generation_settings_changed) self.label_sampling_method = QLabel(self.tr('Sampling Method:'), self) self.combo_box_sampling_method = wl_boxes.Wl_Combo_Box(self) self.stacked_widget_sample_size_text = wl_layouts.Wl_Stacked_Widget( self) self.label_sample_size_first_n_lines = QLabel(self.tr('Sample Size:'), self) self.label_sample_size_systematic_fixed_interval = QLabel( self.tr('Sampling Interval:'), self) self.label_sample_size_systematic_fixed_size = QLabel( self.tr('Sample Size:'), self) self.label_sample_size_random = QLabel(self.tr('Sample Size:'), self) self.stacked_widget_sample_size_val = wl_layouts.Wl_Stacked_Widget( self) self.spin_box_sample_size_first_n_lines = wl_boxes.Wl_Spin_Box(self) self.spin_box_sample_size_systematic_fixed_interval = wl_boxes.Wl_Spin_Box( self) self.spin_box_sample_size_systematic_fixed_size = wl_boxes.Wl_Spin_Box( self) self.spin_box_sample_size_random = wl_boxes.Wl_Spin_Box(self) self.stacked_widget_sample_size_text.addWidget( self.label_sample_size_first_n_lines) self.stacked_widget_sample_size_text.addWidget( self.label_sample_size_systematic_fixed_interval) self.stacked_widget_sample_size_text.addWidget( self.label_sample_size_systematic_fixed_size) self.stacked_widget_sample_size_text.addWidget( self.label_sample_size_random) self.stacked_widget_sample_size_val.addWidget( self.spin_box_sample_size_first_n_lines) self.stacked_widget_sample_size_val.addWidget( self.spin_box_sample_size_systematic_fixed_interval) self.stacked_widget_sample_size_val.addWidget( self.spin_box_sample_size_systematic_fixed_size) self.stacked_widget_sample_size_val.addWidget( self.spin_box_sample_size_random) self.combo_box_sampling_method.addItems([ self.tr('None'), self.tr('First n Lines'), self.tr('Systematic (Fixed Interval)'), self.tr('Systematic (Fixed Size)'), self.tr('Random') ]) self.spin_box_sample_size_first_n_lines.setRange(1, 1000000) self.spin_box_sample_size_systematic_fixed_interval.setRange(2, 10000) self.spin_box_sample_size_systematic_fixed_size.setRange(1, 10000) self.spin_box_sample_size_random.setRange(1, 1000000) self.combo_box_sampling_method.currentTextChanged.connect( self.generation_settings_changed) self.spin_box_sample_size_first_n_lines.valueChanged.connect( self.generation_settings_changed) self.spin_box_sample_size_systematic_fixed_interval.valueChanged.connect( self.generation_settings_changed) self.spin_box_sample_size_systematic_fixed_size.valueChanged.connect( self.generation_settings_changed) self.spin_box_sample_size_random.valueChanged.connect( self.generation_settings_changed) self.group_box_generation_settings.setLayout(wl_layouts.Wl_Layout()) self.group_box_generation_settings.layout().addWidget( self.label_src_file, 0, 0, 1, 2) self.group_box_generation_settings.layout().addWidget( self.combo_box_src_file, 1, 0, 1, 2) self.group_box_generation_settings.layout().addWidget( self.label_tgt_file, 2, 0, 1, 2) self.group_box_generation_settings.layout().addWidget( self.combo_box_tgt_file, 3, 0, 1, 2) self.group_box_generation_settings.layout().addWidget( wl_layouts.Wl_Separator(self), 4, 0, 1, 2) self.group_box_generation_settings.layout().addWidget( self.label_sampling_method, 5, 0) self.group_box_generation_settings.layout().addWidget( self.combo_box_sampling_method, 5, 1) self.group_box_generation_settings.layout().addWidget( self.stacked_widget_sample_size_text, 6, 0) self.group_box_generation_settings.layout().addWidget( self.stacked_widget_sample_size_val, 6, 1) self.group_box_generation_settings.layout().setColumnStretch(1, 1) # Table Settings self.group_box_table_settings = QGroupBox(self.tr('Table Settings'), self) (self.checkbox_show_pct, self.checkbox_show_cumulative, self.checkbox_show_breakdown) = wl_widgets.wl_widgets_table_settings( self, tables=[ self.table_concordancer_parallel_upper, self.table_concordancer_parallel_lower ]) self.checkbox_show_cumulative.hide() self.checkbox_show_breakdown.hide() self.checkbox_show_pct.stateChanged.connect( self.table_settings_changed) self.group_box_table_settings.setLayout(wl_layouts.Wl_Layout()) self.group_box_table_settings.layout().addWidget( self.checkbox_show_pct, 0, 0) self.wrapper_settings.layout().addWidget(self.group_box_token_settings, 0, 0) self.wrapper_settings.layout().addWidget( self.group_box_search_settings, 1, 0) self.wrapper_settings.layout().addWidget( self.group_box_generation_settings, 2, 0) self.wrapper_settings.layout().addWidget(self.group_box_table_settings, 3, 0) self.wrapper_settings.layout().setRowStretch(4, 1) self.load_settings()