diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..81c3f3ef --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/models"] + path = src/models + url = https://github.com/NHLOCAL/SingNER.git diff --git a/src/core/1.py b/src/core/1.py new file mode 100644 index 00000000..0f326814 --- /dev/null +++ b/src/core/1.py @@ -0,0 +1,42 @@ +import flet as ft + +def main(page: ft.Page): + page.title = "Icon Explorer" + + icons = [ + ft.icons.INFO, + ft.icons.QUESTION_MARK, + ft.icons.LIGHTBULB, + ft.icons.TOUCH_APP, + ft.icons.GESTURE, + ft.icons.MORE_HORIZ, + ft.icons.MORE_VERT, + ] + + icon_grid = ft.GridView( + runs_count=3, + spacing=10, + run_spacing=10, + padding=20, + child_aspect_ratio=1.0, + ) + + + for icon_name in icons: + icon_grid.controls.append( + ft.Container( + content=ft.Column( + [ + ft.Icon(icon_name, size=40), + ft.Text(str(icon_name)), # Correct: just use str(icon_name) + ], + alignment=ft.MainAxisAlignment.CENTER, + horizontal_alignment=ft.CrossAxisAlignment.CENTER, + ), + ) + ) + + page.add(icon_grid) + + +ft.app(target=main) \ No newline at end of file diff --git a/src/core/main.py b/src/core/main.py index 615beb6b..b5b8bd30 100644 --- a/src/core/main.py +++ b/src/core/main.py @@ -533,44 +533,85 @@ def toggle_content(e): # Checkboxes global copy_mode, main_folder_only, singles_folder, exist_only, abc_sort, duet_mode - # הגדרות בסיסיות - שימוש ב-Switch עם label דינאמי - copy_mode = ft.Switch( - tooltip="קבע אם להעתיק או להעביר את הקבצים לתיקיית היעד", - label="העתק קבצים" if page.client_storage.get("copy_mode") else "העבר קבצים", - value=page.client_storage.get("copy_mode") or False, - on_change=lambda e: update_switch_label(copy_mode) # עדכון label בעת שינוי - ) - - main_folder_only = ft.Switch( - label="סרוק תיקיה ראשית בלבד" if page.client_storage.get("main_folder_only") else "סרוק עץ תיקיות", - tooltip="בחר אם לסרוק את כל תיקיות המשנה או רק את תיקיית המקור הראשית", - value=page.client_storage.get("main_folder_only") or False, - on_change=lambda e: update_switch_label(main_folder_only) # עדכון label בעת שינוי - ) - - # פונקציה לעדכון label של ה-Switch + # פונקציה לעדכון label של ה-Switch def update_switch_label(switch): - if switch == copy_mode: + if switch == copy_mode.controls[0]: switch.label = "העתק קבצים" if switch.value else "העבר קבצים" - elif switch == main_folder_only: + elif switch == main_folder_only.controls[0]: switch.label = "סרוק תיקיה ראשית בלבד" if switch.value else "סרוק עץ תיקיות" switch.update() - - singles_folder = ft.Checkbox( - label='צור תיקיות סינגלים', - value=page.client_storage.get("singles_folder") if page.client_storage.get("singles_folder") is not None else True # True כברירת מחדל + + + + # Function to create a styled tooltip with markdown content + def create_tooltip(text): + return ft.Tooltip( + message=text, + bgcolor=ft.colors.BLACK87, # Dark background + text_style=ft.TextStyle(color=ft.colors.WHITE), # White text + padding=10, + border_radius=5, + prefer_below=True, + ) + + # Checkboxes with help icons and tooltips + copy_mode = ft.Row( + [ + ft.Switch( + label="העתק קבצים" if page.client_storage.get("copy_mode") else "העבר קבצים", + value=page.client_storage.get("copy_mode") or False, + on_change=lambda e: update_switch_label(copy_mode.controls[0]), # Update label on change + ), + ft.Icon(ft.icons.TIPS_AND_UPDATES, tooltip=create_tooltip("קבע אם להעתיק או להעביר את הקבצים לתיקיית היעד"), size=18, color=ft.colors.SECONDARY), + ], + ) + + + + main_folder_only = ft.Row( + [ + ft.Switch( + label="סרוק תיקיה ראשית בלבד" if page.client_storage.get("main_folder_only") else "סרוק עץ תיקיות", + value=page.client_storage.get("main_folder_only") or False, + on_change=lambda e: update_switch_label(main_folder_only.controls[0]), # Update label on change + ), + ft.Icon(ft.icons.TIPS_AND_UPDATES, tooltip=create_tooltip("בחר אם לסרוק את כל תיקיות המשנה או רק את תיקיית המקור הראשית"), size=18, color=ft.colors.SECONDARY), + ], ) - exist_only = ft.Checkbox( - label="שימוש בתיקיות קיימות", - value=page.client_storage.get("exist_only") or False + singles_folder = ft.Row( + [ + ft.Checkbox( + label='צור תיקיות סינגלים', + value=page.client_storage.get("singles_folder") if page.client_storage.get("singles_folder") is not None else True, + + ), + ft.Icon(ft.icons.TIPS_AND_UPDATES, tooltip=create_tooltip('יצירת תיקייה ייעודית בשם "סינגלים" בתוך כל תיקיית אמן'), size=18, color=ft.colors.SECONDARY), + + ] ) - abc_sort = ft.Checkbox( - label="מיון אלפביתי", - value=page.client_storage.get("abc_sort") or False + + + exist_only = ft.Row( + [ + ft.Checkbox( + label="שימוש בתיקיות קיימות", + value=page.client_storage.get("exist_only") or False + ), + ft.Icon(ft.icons.TIPS_AND_UPDATES, tooltip=create_tooltip("העברת קבצים רק לתיקיות אמנים הקיימות כבר בתיקית היעד"), size=18, color=ft.colors.SECONDARY), + ] ) + abc_sort = ft.Row( + [ + ft.Checkbox( + label="מיון אלפביתי", + value=page.client_storage.get("abc_sort") or False + ), + ft.Icon(ft.icons.TIPS_AND_UPDATES, tooltip=create_tooltip("יצירת תיקיות ראשיות לפי אותיות הא'-ב' וארגון תיקיות האמנים בתוכן"), size=18, color=ft.colors.SECONDARY), + ] + ) # duet_mode @@ -593,11 +634,11 @@ def on_duet_mode_changed(e): # פונקציה לשמירת ההגדרות def open_save_config(e): try: - page.client_storage.set("copy_mode", copy_mode.value) - page.client_storage.set("main_folder_only", main_folder_only.value) - page.client_storage.set("singles_folder", singles_folder.value) - page.client_storage.set("exist_only", exist_only.value) - page.client_storage.set("abc_sort", abc_sort.value) + page.client_storage.set("copy_mode", copy_mode.controls[0].value) # Access Switch inside Row + page.client_storage.set("main_folder_only", main_folder_only.controls[0].value) # Access Switch inside Row + page.client_storage.set("singles_folder", singles_folder.controls[0].value) # Access Checkbox inside Row + page.client_storage.set("exist_only", exist_only.controls[0].value) # Access Checkbox inside Row + page.client_storage.set("abc_sort", abc_sort.controls[0].value) # Access Checkbox inside Row snack_bar = show_snackbar("ההגדרות נשמרו בהצלחה!", ft.colors.GREEN) except Exception as error: @@ -622,7 +663,7 @@ def open_save_config(e): # Progress bar page.window.progress_bar='0.0' - progress_bar = ft.ProgressBar(width=400, value=0) + progress_bar = ft.ProgressBar(width=250 if ANDROID_MODE else 400, value=0) # הצגת הודעת אזהרה לפני הפעלת הסריקה @@ -741,24 +782,39 @@ def request_permission(): margin=10, # margin מסביב ל-Container expand=True, content=ft.Column( # התוכן הקודם נכנס כאן - controls=[ - ft.Row([source_dir_button, source_dir_input], alignment=ft.MainAxisAlignment.CENTER), - ft.Row([target_dir_button, target_dir_input], alignment=ft.MainAxisAlignment.CENTER), + controls=[ + ft.Column( + #expand=True, + horizontal_alignment=ft.CrossAxisAlignment.STRETCH, + controls=[ + ft.Row([source_dir_button, source_dir_input], alignment=ft.MainAxisAlignment.CENTER, expand=True), + ft.Row([target_dir_button, target_dir_input], alignment=ft.MainAxisAlignment.CENTER, expand=True), + ] + ), - ft.Row([progress_bar], alignment=ft.MainAxisAlignment.CENTER), - - ft.Row( - [ - organize_button, - fixed_button, - ], + ft.Column( + #expand=True, alignment=ft.MainAxisAlignment.CENTER, - expand=True, + horizontal_alignment=ft.CrossAxisAlignment.CENTER, + spacing=15, + controls=[ + progress_bar, + ft.Row( + [ + organize_button, + fixed_button, + ], + alignment=ft.MainAxisAlignment.CENTER, + expand=True, + ), + ], ), + + ], spacing=15, - alignment=ft.MainAxisAlignment.CENTER, - horizontal_alignment=ft.CrossAxisAlignment.CENTER, + alignment=ft.MainAxisAlignment.CENTER if ANDROID_MODE else ft.MainAxisAlignment.SPACE_AROUND, + horizontal_alignment=ft.CrossAxisAlignment.STRETCH, expand=True, ), ), @@ -771,6 +827,7 @@ def request_permission(): col={"xs": 2, "sm": 1, "md": 1}, content=ft.Container( padding=ft.padding.only(10, 20, 10, 10) if ANDROID_MODE else ft.padding.only(30, 30, 30, 20), + expand=True, margin=ft.padding.all(0), content=ft.Column( [ @@ -790,6 +847,7 @@ def request_permission(): ft.ListTile(title=copy_mode, content_padding=PADDING_ITEMS_LIST, ), + ft.ListTile(title=main_folder_only, content_padding=PADDING_ITEMS_LIST, ), @@ -800,16 +858,16 @@ def request_permission(): ), ft.ListTile(title=singles_folder, - content_padding=PADDING_ITEMS_LIST, - subtitle=ft.Text('יצירת תיקייה ייעודית בשם "סינגלים" בתוך כל תיקיית אמן',) + content_padding=PADDING_ITEMS_LIST, ), + + ft.ListTile(title=abc_sort, content_padding=PADDING_ITEMS_LIST, - subtitle=ft.Text("יצירת תיקיות ראשיות לפי אותיות הא'-ב' וארגון תיקיות האמנים בתוכן"), ), + ft.ListTile(title=exist_only, content_padding=PADDING_ITEMS_LIST, - subtitle=ft.Text(" העברת קבצים רק לתיקיות אמנים הקיימות כבר בתיקית היעד") ), ft.Row( @@ -824,8 +882,8 @@ def request_permission(): ), ), ], - alignment=ft.MainAxisAlignment.START, # Distribute space around items - vertical_alignment=ft.CrossAxisAlignment.START, # align items to top + alignment=ft.MainAxisAlignment.SPACE_BETWEEN, + vertical_alignment=ft.CrossAxisAlignment.STRETCH, # align items to top spacing=20, run_spacing=10, columns=2, @@ -883,11 +941,11 @@ def progress_callback(progress): sorter = MusicSorter( source_dir = source_dir, target_dir = target_dir if mode == "organize" else None, # העברת target_dir רק אם צריך - copy_mode = copy_mode.value, - abc_sort = abc_sort.value, - exist_only = exist_only.value, - singles_folder = singles_folder.value, - main_folder_only = main_folder_only.value, + copy_mode = copy_mode.controls[0].value, + abc_sort = abc_sort.controls[0].value, + exist_only = exist_only.controls[0].value, + singles_folder = singles_folder.controls[0].value, + main_folder_only = main_folder_only.controls[0].value, duet_mode = duet_mode.value, progress_callback = progress_callback ) diff --git a/src/core/models/singer_ner_he/iteration_data.json b/src/core/models/singer_ner_he/iteration_data.json index 454e1bcf..1f65528f 100644 --- a/src/core/models/singer_ner_he/iteration_data.json +++ b/src/core/models/singer_ner_he/iteration_data.json @@ -1,167 +1,179 @@ { "0": { - "ner": 12760.009605653426 + "ner": 16859.562147974026 }, "1": { - "ner": 8170.318919559713 + "ner": 5990.5139773112405 }, "2": { - "ner": 6891.266782209631 + "ner": 4478.45205857907 }, "3": { - "ner": 6025.393886494811 + "ner": 3676.5353477947865 }, "4": { - "ner": 5811.96771290383 + "ner": 3041.555204119301 }, "5": { - "ner": 5512.271173835842 + "ner": 2708.61155760391 }, "6": { - "ner": 5296.490141148527 + "ner": 2365.0328221431196 }, "7": { - "ner": 5235.260896612553 + "ner": 2151.2886557242705 }, "8": { - "ner": 5046.740624489254 + "ner": 1944.4288875196373 }, "9": { - "ner": 4973.830577046772 + "ner": 1857.0009259195094 }, "10": { - "ner": 5017.859998598908 + "ner": 1626.218638582523 }, "11": { - "ner": 4900.961947907638 + "ner": 1550.237247732257 }, "12": { - "ner": 4838.758090039101 + "ner": 1458.1374000199235 }, "13": { - "ner": 4886.875202931668 + "ner": 1361.1880153318818 }, "14": { - "ner": 4714.624255783186 + "ner": 1238.540525904591 }, "15": { - "ner": 4738.327280185656 + "ner": 1147.1534748997115 }, "16": { - "ner": 4565.160664788347 + "ner": 1073.5846564558906 }, "17": { - "ner": 4583.78275722923 + "ner": 983.307164797089 }, "18": { - "ner": 4495.220605149534 + "ner": 1081.7067796060082 }, "19": { - "ner": 4534.810179279405 + "ner": 913.0313918338494 }, "20": { - "ner": 4500.498598112403 + "ner": 877.9734199239106 }, "21": { - "ner": 4424.467961309918 + "ner": 863.2030305059395 }, "22": { - "ner": 4418.58057027781 + "ner": 848.9521387984764 }, "23": { - "ner": 4177.6422341950165 + "ner": 810.7104661539681 }, "24": { - "ner": 4473.728806059217 + "ner": 815.1893857952681 }, "25": { - "ner": 4482.807123740337 + "ner": 771.2494014067618 }, "26": { - "ner": 4295.435655848486 + "ner": 738.824911469887 }, "27": { - "ner": 4296.125647655365 + "ner": 614.671281438121 }, "28": { - "ner": 4211.3802648941555 + "ner": 657.5577547864115 }, "29": { - "ner": 4226.050618910973 + "ner": 677.2730842475358 }, "30": { - "ner": 4343.9247733939055 + "ner": 611.8064976184428 }, "31": { - "ner": 4251.641707995066 + "ner": 621.2248731267007 }, "32": { - "ner": 4284.022606448415 + "ner": 582.6218950733266 }, "33": { - "ner": 4354.118602595073 + "ner": 629.9903440027293 }, "34": { - "ner": 4372.461272659416 + "ner": 649.1900186419267 }, "35": { - "ner": 4378.70702104278 + "ner": 548.2206032757789 }, "36": { - "ner": 4245.001379737945 + "ner": 534.2287706710158 }, "37": { - "ner": 4270.430685805459 + "ner": 562.856146505825 }, "38": { - "ner": 4208.291241037127 + "ner": 497.29451116524297 }, "39": { - "ner": 4250.659736461786 + "ner": 502.84228336930033 }, "40": { - "ner": 4201.661238122778 + "ner": 505.70431783616027 }, "41": { - "ner": 4174.294246218296 + "ner": 491.84543411072286 }, "42": { - "ner": 4317.815189482398 + "ner": 500.52685552654424 }, "43": { - "ner": 4206.800198851955 + "ner": 471.9014436136449 }, "44": { - "ner": 4211.050399543626 + "ner": 439.75506441152066 }, "45": { - "ner": 4164.989329134082 + "ner": 473.54850487114686 }, "46": { - "ner": 4169.060926826847 + "ner": 448.4077130363622 }, "47": { - "ner": 4246.892852349701 + "ner": 460.9751814667036 }, "48": { - "ner": 4376.177885754265 + "ner": 418.0534646302599 }, "49": { - "ner": 4144.422442224529 + "ner": 400.5616566724267 }, "50": { - "ner": 4229.421797165746 + "ner": 437.7078555798779 }, "51": { - "ner": 4100.578560124174 + "ner": 338.9996890601164 }, "52": { - "ner": 4273.158234436391 + "ner": 376.15340698547976 }, "53": { - "ner": 4141.029963890384 + "ner": 396.6231835187324 }, "54": { - "ner": 4119.760375687587 + "ner": 414.5204740966595 + }, + "55": { + "ner": 400.14211323714784 + }, + "56": { + "ner": 366.21410014959565 + }, + "57": { + "ner": 371.0297732047275 + }, + "58": { + "ner": 354.68620961440996 } } \ No newline at end of file diff --git a/src/core/models/singer_ner_he/meta.json b/src/core/models/singer_ner_he/meta.json index 7ca833db..be419af8 100644 --- a/src/core/models/singer_ner_he/meta.json +++ b/src/core/models/singer_ner_he/meta.json @@ -1,7 +1,7 @@ { "lang":"he", "name":"singer_ner_he", - "version":"0.23.0", + "version":"0.23.4", "spacy_version":">=3.7.5,<3.8.0", "description":"Model for recognizing singer names in Hebrew song titles", "author":"nhlocal", diff --git a/src/core/models/singer_ner_he/ner/model b/src/core/models/singer_ner_he/ner/model index be1b097d..5a3311f5 100644 Binary files a/src/core/models/singer_ner_he/ner/model and b/src/core/models/singer_ner_he/ner/model differ diff --git a/src/core/models/singer_ner_he/vocab/strings.json b/src/core/models/singer_ner_he/vocab/strings.json index 006c07e1..40cba0c0 100644 --- a/src/core/models/singer_ner_he/vocab/strings.json +++ b/src/core/models/singer_ner_he/vocab/strings.json @@ -35,7 +35,6 @@ ")/\u00af", "):", "*", - "+", "-", "-((", "-))", @@ -59,7 +58,6 @@ "/", "/3", "/d", - "/\u00af", "0", "0.0", "0.o", @@ -321,7 +319,6 @@ "\u00ac", "\u00ac_\u00ac", "\u00af", - "\u00af\\", "\u00af\\(x)/\u00af", "\u00af\\(\u30c4)/\u00af", "\u00b0", @@ -348,7 +345,6 @@ "\u253b\u2501\u253b", "\u256f", "\u25a1", - "\u30c4", "\ufe35", "\uff09" ] \ No newline at end of file diff --git a/src/core/try2.py b/src/core/try2.py deleted file mode 100644 index d6d5b338..00000000 --- a/src/core/try2.py +++ /dev/null @@ -1,73 +0,0 @@ -import flet as ft - -def main(page): - page.title = "ListTile Examples" - page.add( - ft.Card( - content=ft.Container( - width=500, - content=ft.Column( - [ - ft.ListTile( - title=ft.Text("One-line list tile"), - ), - ft.ListTile(title=ft.Text("One-line dense list tile"), dense=True), - ft.ListTile( - leading=ft.Icon(ft.icons.SETTINGS), - title=ft.Text("One-line selected list tile"), - selected=True, - ), - ft.ListTile( - leading=ft.Image(src="/icons/icon-192.png", fit="contain"), - title=ft.Text("One-line with leading control"), - ), - ft.ListTile( - title=ft.Text("One-line with trailing control"), - trailing=ft.PopupMenuButton( - icon=ft.icons.MORE_VERT, - items=[ - ft.PopupMenuItem(text="Item 1"), - ft.PopupMenuItem(text="Item 2"), - ], - ), - ), - ft.ListTile( - leading=ft.Icon(ft.icons.ALBUM), - title=ft.Text("One-line with leading and trailing controls"), - trailing=ft.PopupMenuButton( - icon=ft.icons.MORE_VERT, - items=[ - ft.PopupMenuItem(text="Item 1"), - ft.PopupMenuItem(text="Item 2"), - ], - ), - ), - ft.ListTile( - leading=ft.Checkbox( - value=page.client_storage.get("abc_sort") or False - ), - subtitle=ft.Text("התוכנה תיצור תיקיות ראשיות לכל אות באלפבית, ותכניס את תיקיות האמנים לתוכן"), - title=ft.Text("מיון אלפביתי"), - ), - - ft.ListTile( - leading=ft.Icon(ft.icons.SNOOZE), - title=ft.Text("Two-line with leading and trailing controls"), - subtitle=ft.Text("Here is a second title."), - trailing=ft.PopupMenuButton( - icon=ft.icons.MORE_VERT, - items=[ - ft.PopupMenuItem(text="Item 1"), - ft.PopupMenuItem(text="Item 2"), - ], - ), - ), - ], - spacing=0, - ), - padding=ft.padding.symmetric(vertical=10), - ) - ) - ) - -ft.app(main) \ No newline at end of file diff --git a/src/models b/src/models new file mode 160000 index 00000000..0ab70ac6 --- /dev/null +++ b/src/models @@ -0,0 +1 @@ +Subproject commit 0ab70ac6d759f3b46f7f7bbccafdb992add4e987