add syllables in database and tool

This commit is contained in:
BimDav
2024-02-13 17:17:40 +01:00
parent 1f332def33
commit d6066ca01e
13 changed files with 45170 additions and 11 deletions
@@ -16,6 +16,16 @@ func _ready() -> void:
var description_line: = description_line_class.instantiate()
description_container.add_child(description_line)
description_line.set_gp(res)
Database.db.query("SELECT * FROM Syllables")
for res in Database.db.query_result:
var description_line: = description_line_class.instantiate()
description_container.add_child(description_line)
res.Grapheme = res.Syllable
res.Phoneme = ""
description_line.set_gp(res)
description_line.image_preview.hide()
description_line.image_upload_button.hide()
func _on_back_button_pressed() -> void:
+6
View File
@@ -44,6 +44,10 @@ func _on_word_list_button_pressed() -> void:
get_tree().change_scene_to_file("res://sources/language_tool/word_list.tscn")
func _on_syllable_list_button_pressed() -> void:
get_tree().change_scene_to_file("res://sources/language_tool/syllable_list.tscn")
func _on_sentence_list_button_pressed() -> void:
get_tree().change_scene_to_file("res://sources/language_tool/sentence_list.tscn")
@@ -134,3 +138,5 @@ func _on_add_word_list_button_pressed() -> void:
file_dialog.show()
_update_add_word_list_button()
+10 -3
View File
@@ -41,6 +41,11 @@ layout_mode = 2
theme_override_font_sizes/font_size = 100
text = "Word List"
[node name="SyllableListButton" type="Button" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 100
text = "Syllable List"
[node name="SentenceListButton" type="Button" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 100
@@ -73,9 +78,10 @@ layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -552.5
offset_right = 552.5
offset_bottom = 158.0
offset_left = -550.0
offset_top = 40.0
offset_right = 555.0
offset_bottom = 198.0
grow_horizontal = 2
theme_override_font_sizes/font_size = 120
text = "Kalulu Language Tool"
@@ -161,6 +167,7 @@ text = "Change word list"
[connection signal="pressed" from="CenterContainer/VBoxContainer/GPListButton" to="." method="_on_gp_list_button_pressed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/WordListButton" to="." method="_on_word_list_button_pressed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/SyllableListButton" to="." method="_on_syllable_list_button_pressed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/SentenceListButton" to="." method="_on_sentence_list_button_pressed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/LessonListButton" to="." method="_on_lesson_list_button_pressed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/TracingBuilderButton" to="." method="_on_tracing_builder_button_pressed"]
+1
View File
@@ -10,6 +10,7 @@ script = ExtResource("2_q3ll5")
element_scene = ExtResource("2_4jv4m")
[node name="Word" parent="VBoxContainer/WordListElement/TabContainer/NormalContainer" index="1"]
visible = false
text = "Sentence"
[node name="Graphemes" parent="VBoxContainer/WordListElement/TabContainer/NormalContainer" index="2"]
@@ -2,6 +2,12 @@ extends "res://sources/language_tool/word_list_element.gd"
const word_list_element_scene: = preload("res://sources/language_tool/word_list_element.tscn")
func _ready() -> void:
super()
graphemes_label.hide()
func update_lesson() -> void:
var m: = -1
for gp_id in gp_ids:
@@ -18,7 +24,7 @@ func _add_from_additional_word_list(new_text: String) -> int:
var word_list_element: = word_list_element_scene.instantiate()
var all_found: = true
var word_ids: Array[int] = []
for word in new_text_clean.split(" "):
for word in new_text_clean.split(" ", false):
var word_id: int = word_list_element._try_to_complete_from_word(word)
word_ids.append(word_id)
if word_id < 0:
@@ -13,6 +13,17 @@ sub_table_phon_column = "Word"
relational_table = "WordsInSentences"
sub_table_id = "WordID"
[node name="Word" parent="TabContainer/NormalContainer" index="1"]
size_flags_vertical = 1
vertical_alignment = 1
autowrap_mode = 2
[node name="WordEdit" parent="TabContainer/EditContainer" index="1"]
placeholder_text = "Press enter for autocomplete"
[node name="GraphemesEdit" parent="TabContainer/EditContainer" index="2"]
placeholder_text = "Each word in the sentence"
[editable path="TabContainer/NormalContainer/EditButton"]
[editable path="TabContainer/EditContainer/MinusButton"]
[editable path="TabContainer/EditContainer/ValidateButton"]
+25
View File
@@ -0,0 +1,25 @@
[gd_scene load_steps=3 format=3 uid="uid://c7036ue2wmauy"]
[ext_resource type="PackedScene" uid="uid://dfw7m0a7148fu" path="res://sources/language_tool/word_list.tscn" id="1_wq0y5"]
[ext_resource type="PackedScene" uid="uid://rimsx0i5seyp" path="res://sources/language_tool/syllable_list_element.tscn" id="2_r4j7q"]
[node name="SyllableList" instance=ExtResource("1_wq0y5")]
element_scene = ExtResource("2_r4j7q")
[node name="Word" parent="VBoxContainer/WordListElement/TabContainer/NormalContainer" index="1"]
text = "Syllable"
[editable path="VBoxContainer/WordListElement"]
[editable path="VBoxContainer/WordListElement/TabContainer/NormalContainer/EditButton"]
[editable path="VBoxContainer/WordListElement/TabContainer/EditContainer/MinusButton"]
[editable path="VBoxContainer/WordListElement/TabContainer/EditContainer/ValidateButton"]
[editable path="VBoxContainer/WordListElement/SaveButton"]
[editable path="VBoxContainer/WordListElement/BackButton"]
[editable path="NewGPLayer/VBoxContainer/Title"]
[editable path="NewGPLayer/VBoxContainer/Title/TabContainer/NormalContainer/EditButton"]
[editable path="NewGPLayer/VBoxContainer/Title/TabContainer/EditContainer/DeleteButton"]
[editable path="NewGPLayer/VBoxContainer/Title/TabContainer/EditContainer/ValidateButton"]
[editable path="NewGPLayer/VBoxContainer/NewGP"]
[editable path="NewGPLayer/VBoxContainer/NewGP/TabContainer/NormalContainer/EditButton"]
[editable path="NewGPLayer/VBoxContainer/NewGP/TabContainer/EditContainer/DeleteButton"]
[editable path="NewGPLayer/VBoxContainer/NewGP/TabContainer/EditContainer/ValidateButton"]
@@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://rimsx0i5seyp"]
[ext_resource type="PackedScene" uid="uid://dx33ijlgd8m3w" path="res://sources/language_tool/word_list_element.tscn" id="1_dnvqy"]
[node name="SyllableListElement" instance=ExtResource("1_dnvqy")]
table = "Syllables"
table_graph_column = "Syllable"
relational_table = "GPsInSyllables"
[editable path="TabContainer/NormalContainer/EditButton"]
[editable path="TabContainer/EditContainer/MinusButton"]
[editable path="TabContainer/EditContainer/ValidateButton"]
+5 -5
View File
@@ -43,7 +43,7 @@ unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.3
theme_override_font_sizes/font_size = 100
theme_override_font_sizes/font_size = 70
text = "7"
horizontal_alignment = 1
clip_text = true
@@ -52,7 +52,7 @@ clip_text = true
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 100
theme_override_font_sizes/font_size = 70
text = "Bonjour"
horizontal_alignment = 1
clip_text = true
@@ -61,7 +61,7 @@ clip_text = true
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 100
theme_override_font_sizes/font_size = 70
text = "b on j ou r"
horizontal_alignment = 1
@@ -87,7 +87,7 @@ texture = ExtResource("3_mgblq")
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 100
theme_override_font_sizes/font_size = 70
text = "bonjour"
alignment = 1
@@ -95,7 +95,7 @@ alignment = 1
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 100
theme_override_font_sizes/font_size = 70
text = "b on j ou r"
alignment = 1
selecting_enabled = false
+2 -2
View File
@@ -8,7 +8,7 @@ const _symbols_to_string = {
"%" : "pcent",
"§" : "para"
}
const base_path: = "res://language_resources/"
const base_path: = "user://language_resources/"
const look_and_learn_images: = "/look_and_learn/images/"
const look_and_learn_sounds: = "/look_and_learn/sounds/"
const look_and_learn_videos: = "/look_and_learn/video/"
@@ -17,7 +17,7 @@ const video_extension: = ".ogv"
const image_extension: = ".png"
const sound_extension: = ".mp3"
var language: String:
var language: String = "french":
set(value):
language = value
db_path = base_path + language + "/language.db"