Skip to content

Commit

Permalink
Work Area: Fix Wordlist Generator - Filter results - Number of syllables
Browse files Browse the repository at this point in the history
  • Loading branch information
BLKSerene committed Jan 2, 2025
1 parent 07f76bf commit 98d849a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<div align="center"><h1>📄 Changelog</h1></div>

## [3.6.0](https://github.com/BLKSerene/Wordless/releases/tag/3.6.0) - ??/??/2024
## [3.6.0](https://github.com/BLKSerene/Wordless/releases/tag/3.6.0) - ??/??/2025
### 🎉 New Features
- Measures: Add effect size - conditional probability / ΔP / mutual information (normalized) / μ-value / pointwise mutual information (squared) / pointwise mutual information (normalized) / relative risk
- Settings: Add Settings - Measures - Effect Size - Mutual Information / Pointwise Mutual Information / Pointwise Mutual Information (Cubic) / Pointwise Mutual Information (Squared)
Expand All @@ -31,6 +31,7 @@
- File Area: Fix Open Files - Encoding
- File Area: Fix Open Files - Opening Non-text Files - Do not show this again
- Utils: Fix Wordless's Japanese kanji tokenizer
- Work Area: Fix Wordlist Generator - Filter results - Number of syllables
- Work Area: Fix Work Area - Filter results - File to filter

### ❌ Removals
Expand Down
13 changes: 10 additions & 3 deletions wordless/wl_results/wl_results_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ def __init__(self, main, table):
self.col_text_dispersion = self.main.settings_global['measures_dispersion'][measure_dispersion]['col_text']
self.col_text_adjusted_freq = self.main.settings_global['measures_adjusted_freq'][measure_adjusted_freq]['col_text']

if self.tab == 'wordlist_generator':
self.has_syllabification = settings['generation_settings']['syllabification']
else:
self.has_syllabification = True

self.has_dispersion = measure_dispersion != 'none'
self.has_adjusted_freq = measure_adjusted_freq != 'none'

Expand All @@ -404,7 +409,7 @@ def __init__(self, main, table):
settings = self.settings, filter_name = f'len_{self.type_node}'
))

if self.tab == 'wordlist_generator':
if self.tab == 'wordlist_generator' and settings['generation_settings']['syllabification']:
self.layouts_filters.append(widgets_filter(
self,
label = self.tr('Number of syllables:'),
Expand Down Expand Up @@ -468,7 +473,9 @@ class Wl_Worker_Results_Filter_Wordlist_Generator(wl_threading.Wl_Worker):
def run(self):
if self.dialog.tab == 'wordlist_generator':
col_node = self.dialog.table.find_header_hor(self.tr('Token'))
col_num_syls = self.dialog.table.find_header_hor(self.tr('Syllabification'))

if self.dialog.has_syllabification:
col_num_syls = self.dialog.table.find_header_hor(self.tr('Syllabification'))
elif self.dialog.tab == 'ngram_generator':
col_node = self.dialog.table.find_header_hor(self.tr('N-gram'))

Expand Down Expand Up @@ -536,7 +543,7 @@ def run(self):
if self.dialog.table.model().item(i, col_freq).val > 0:
filters.append(len_node_min <= len_node <= len_node_max)

if self.dialog.tab == 'wordlist_generator':
if self.dialog.tab == 'wordlist_generator' and self.dialog.has_syllabification:
filter_num_syls = False
syllabification = self.dialog.table.model().item(i, col_num_syls).text()

Expand Down

0 comments on commit 98d849a

Please sign in to comment.