diff --git a/app.py b/app.py index f6bd652..6fc083e 100755 --- a/app.py +++ b/app.py @@ -174,7 +174,9 @@ def create_app(): 'BIC': gettext('BIC'), 'MI': gettext('MI'), 'logDice': gettext('logDice'), - 't-score': gettext('t-score') + 't-score': gettext('t-score'), + 'Max depth': gettext('Max depth'), + 'MDD': gettext('MDD') } if 'Absolute frequency in second treebank' in head: table_columns2displayed_table_columns['Absolute frequency'] = gettext('Frequency in A') @@ -254,7 +256,9 @@ def create_app(): 'BIC': gettext('BIC'), 'MI': gettext('MI'), 'logDice': gettext('logDice'), - 't-score': gettext('t-score') + 't-score': gettext('t-score'), + 'Max depth': gettext('Max depth'), + 'MDD': gettext('MDD') } if 'Absolute frequency in second treebank' in head: table_columns2displayed_table_columns['Absolute frequency'] = gettext('Frequency in A') @@ -407,6 +411,7 @@ def create_app(): configs['dependency_type'] = 'labeled_trees' in form and form['labeled_trees'] == 'on' configs['node_order'] = 'fixed_order' in form and form['fixed_order'] == 'on' configs['association_measures'] = 'association_measures' in form and form['association_measures'] == 'on' + configs['complexity_measures'] = 'yes' if 'complexity_measures' in form and form['complexity_measures'] == 'on' else 'no' configs['label_whitelist'] = [] configs['root_whitelist'] = [] diff --git a/messages.pot b/messages.pot index 7d25c8a..87f3d18 100644 --- a/messages.pot +++ b/messages.pot @@ -1,14 +1,14 @@ # Translations template for PROJECT. -# Copyright (C) 2025 ORGANIZATION +# Copyright (C) 2026 ORGANIZATION # This file is distributed under the same license as the PROJECT project. -# FIRST AUTHOR , 2025. +# FIRST AUTHOR , 2026. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2025-05-17 13:14+0200\n" +"POT-Creation-Date: 2026-08-01 20:04+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,126 +17,134 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.14.0\n" -#: app.py:164 app.py:244 +#: app.py:164 app.py:246 msgid "Tree" msgstr "" -#: app.py:165 app.py:245 +#: app.py:165 app.py:247 msgid "Frequency" msgstr "" -#: app.py:166 app.py:246 +#: app.py:166 app.py:248 msgid "Frequency in B" msgstr "" -#: app.py:167 app.py:247 +#: app.py:167 app.py:249 msgid "Order" msgstr "" -#: app.py:168 app.py:248 +#: app.py:168 app.py:250 msgid "Number of nodes" msgstr "" -#: app.py:169 app.py:249 +#: app.py:169 app.py:251 msgid "Head node" msgstr "" -#: app.py:170 app.py:250 +#: app.py:170 app.py:252 msgid "Grew-match URL" msgstr "" -#: app.py:171 app.py:251 +#: app.py:171 app.py:253 +msgid "Max depth" +msgstr "" + +#: app.py:172 app.py:254 +msgid "MDD" +msgstr "" + +#: app.py:173 app.py:255 msgid "Ratio" msgstr "" -#: app.py:172 app.py:252 +#: app.py:174 app.py:256 msgid "%DIFF" msgstr "" -#: app.py:173 app.py:253 +#: app.py:175 app.py:257 msgid "OR" msgstr "" -#: app.py:174 app.py:254 +#: app.py:176 app.py:258 msgid "BIC" msgstr "" -#: app.py:175 app.py:255 +#: app.py:177 app.py:259 msgid "MI" msgstr "" -#: app.py:176 app.py:256 +#: app.py:178 app.py:260 msgid "logDice" msgstr "" -#: app.py:177 app.py:257 +#: app.py:179 app.py:261 msgid "t-score" msgstr "" -#: app.py:180 app.py:260 +#: app.py:182 app.py:264 msgid "Frequency in A" msgstr "" -#: app.py:341 app.py:342 +#: app.py:345 app.py:346 msgid "Please insert either input url or file, not both of them." msgstr "" -#: app.py:352 app.py:447 +#: app.py:356 app.py:452 msgid "Incorrect URL!" msgstr "" -#: app.py:354 app.py:355 +#: app.py:358 app.py:359 msgid "Please insert either input url or provide a file." msgstr "" -#: app.py:361 +#: app.py:365 msgid "" "Please insert an integer number or a range separated with `-`, without " "spaces. Example: 3 or 2-4." msgstr "" -#: app.py:366 +#: app.py:370 msgid "" "Please set a maximum display size to a number equal or lower to 4, when " "extracting Incomplete trees. Or search through complete trees (Complete " "trees parameter)." msgstr "" -#: app.py:375 +#: app.py:379 msgid "Please select at least one node type." msgstr "" -#: app.py:380 +#: app.py:384 msgid "Node option" msgstr "" -#: app.py:380 +#: app.py:384 msgid "is not supported. Please enter valid options." msgstr "" -#: app.py:435 app.py:436 +#: app.py:440 app.py:441 msgid "Please insert either compare url or file, not both of them." msgstr "" -#: app.py:459 +#: app.py:464 msgid "Please insert an Integer." msgstr "" -#: app.py:495 +#: app.py:500 msgid "" "Processing failed! Please recheck your settings, e.g. input format or " "head node description." msgstr "" -#: app.py:504 +#: app.py:509 msgid "Frequency " msgstr "" -#: app.py:504 +#: app.py:509 msgid "Frequency in A " msgstr "" -#: app.py:505 templates/base.html:23 templates/base.html:24 +#: app.py:510 templates/base.html:23 templates/base.html:24 #: templates/base.html:26 templates/index.html:8 templates/result.html:21 msgid "code" msgstr "" @@ -193,11 +201,11 @@ msgstr "" msgid "impressum_card_content" msgstr "" -#: templates/about.html:83 +#: templates/about.html:60 msgid "about_card_content" msgstr "" -#: templates/about.html:94 +#: templates/about.html:65 msgid "version_card_content" msgstr "" @@ -245,20 +253,20 @@ msgstr "" msgid "Upload a treebank" msgstr "" -#: templates/index.html:12 templates/index.html:20 templates/index.html:191 -#: templates/index.html:198 +#: templates/index.html:12 templates/index.html:20 templates/index.html:206 +#: templates/index.html:213 msgid "in CONLL-U format" msgstr "" #: templates/index.html:12 templates/index.html:43 templates/index.html:83 #: templates/index.html:98 templates/index.html:120 templates/index.html:126 #: templates/index.html:132 templates/index.html:142 templates/index.html:148 -#: templates/index.html:156 templates/index.html:171 templates/index.html:190 -#: templates/index.html:191 +#: templates/index.html:156 templates/index.html:186 templates/index.html:205 +#: templates/index.html:206 msgid "Help" msgstr "" -#: templates/index.html:15 templates/index.html:194 +#: templates/index.html:15 templates/index.html:209 msgid "Browse" msgstr "" @@ -266,11 +274,11 @@ msgstr "" msgid "Upload" msgstr "" -#: templates/index.html:29 templates/index.html:208 +#: templates/index.html:29 templates/index.html:223 msgid "Or" msgstr "" -#: templates/index.html:29 templates/index.html:208 +#: templates/index.html:29 templates/index.html:223 msgid "insert a URL link to a treebank in CONLL-U format" msgstr "" @@ -311,12 +319,12 @@ msgid "include names of dependency relations" msgstr "" #: templates/index.html:87 templates/index.html:102 templates/index.html:160 -#: templates/index.html:175 +#: templates/index.html:175 templates/index.html:190 msgid "No" msgstr "" #: templates/index.html:90 templates/index.html:105 templates/index.html:163 -#: templates/index.html:178 +#: templates/index.html:178 templates/index.html:193 msgid "Yes" msgstr "" @@ -381,46 +389,54 @@ msgid "print MI, logDice and t-score" msgstr "" #: templates/index.html:171 +msgid "Complexity measures" +msgstr "" + +#: templates/index.html:171 +msgid "print maximum tree depth and mean dependency distance (MDD)" +msgstr "" + +#: templates/index.html:186 msgid "Complete trees" msgstr "" -#: templates/index.html:171 +#: templates/index.html:186 msgid "extract head node with all its dependants" msgstr "" -#: templates/index.html:171 +#: templates/index.html:186 msgid "" "Note: Extracting incomplete trees ('No' option) is slow and limited to a " "maximum tree size of 4 nodes." msgstr "" -#: templates/index.html:186 +#: templates/index.html:201 msgid "Compare treebanks" msgstr "" -#: templates/index.html:190 +#: templates/index.html:205 msgid "" "Select a reference treebank to identify key phenomena (prints the " "%DIFF, BIC and OR keyness scores)." msgstr "" -#: templates/index.html:191 templates/index.html:198 +#: templates/index.html:206 templates/index.html:213 msgid "Upload a compare corpus" msgstr "" -#: templates/index.html:224 +#: templates/index.html:239 msgid "Submit" msgstr "" -#: templates/index.html:232 +#: templates/index.html:247 msgid "No results" msgstr "" -#: templates/index.html:233 +#: templates/index.html:248 msgid "Processing with your settings didnt produce any results!" msgstr "" -#: templates/index.html:249 +#: templates/index.html:264 msgid "" "Extracting incomplete trees ('No' option) is slow and limited to a " "maximum tree size of 4 nodes." diff --git a/requirements.txt b/requirements.txt index 6a9ca33..e026ba6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Flask==3.0.0 requests==2.31.0 flask-babel==4.0.0 -stark-trees==3.1.0 +stark-trees @ git+https://github.com/clarinsi/STARK.git@f0a61fe59bdc9b123beabfcdb78544ae01c961d2 conllu==6.0.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 98f9950..7afb856 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setup(name='stark-api', 'Flask==3.0.0', 'requests==2.31.0', 'flask-babel==4.0.0', - 'stark-trees==3.1.0', + 'stark-trees @ git+https://github.com/clarinsi/STARK.git@f0a61fe59bdc9b123beabfcdb78544ae01c961d2', 'conllu==6.0.0' ], ) \ No newline at end of file diff --git a/static/js/init.js b/static/js/init.js index 5401cfe..99c24d7 100644 --- a/static/js/init.js +++ b/static/js/init.js @@ -1,5 +1,5 @@ // Global array to store input names -var globalInputList = ['display_size', 'file', 'association_measures', 'labeled_trees', 'node_type_upos', 'fixed_order', 'input_url', 'node_type_lemma', 'root_restriction', 'node_type_form', 'frequency_threshold', 'node_type_none', 'query', 'compare_url', 'compare_file', 'ignored_labels', 'complete_trees']; +var globalInputList = ['display_size', 'file', 'association_measures', 'complexity_measures', 'labeled_trees', 'node_type_upos', 'fixed_order', 'input_url', 'node_type_lemma', 'root_restriction', 'node_type_form', 'frequency_threshold', 'node_type_none', 'query', 'compare_url', 'compare_file', 'ignored_labels', 'complete_trees']; var visualInputList = ['advanced-tree-expand', 'compare-expand'] // Function to store values to local storage diff --git a/templates/index.html b/templates/index.html index 41ba260..993c95f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -166,6 +166,21 @@ +
+
+ +
+
+ +
+
+
+
diff --git a/translations/en/LC_MESSAGES/messages.mo b/translations/en/LC_MESSAGES/messages.mo index 383c390..8253bf3 100644 Binary files a/translations/en/LC_MESSAGES/messages.mo and b/translations/en/LC_MESSAGES/messages.mo differ diff --git a/translations/en/LC_MESSAGES/messages.po b/translations/en/LC_MESSAGES/messages.po index b4db877..2ba0852 100644 --- a/translations/en/LC_MESSAGES/messages.po +++ b/translations/en/LC_MESSAGES/messages.po @@ -425,6 +425,18 @@ msgstr "specify the minimum frequency of a tree in the treebank" msgid "Association measures" msgstr "Association measures" +msgid "Complexity measures" +msgstr "Complexity measures" + +msgid "print maximum tree depth and mean dependency distance (MDD)" +msgstr "print maximum tree depth and mean dependency distance (MDD)" + +msgid "Max depth" +msgstr "Max depth" + +msgid "MDD" +msgstr "MDD" + #: templates/index.html:156 msgid "print MI, logDice and t-score" msgstr "print MI, logDice and t-score" diff --git a/translations/sl/LC_MESSAGES/messages.mo b/translations/sl/LC_MESSAGES/messages.mo index 79d046a..bb056e1 100644 Binary files a/translations/sl/LC_MESSAGES/messages.mo and b/translations/sl/LC_MESSAGES/messages.mo differ diff --git a/translations/sl/LC_MESSAGES/messages.po b/translations/sl/LC_MESSAGES/messages.po index 86152e1..9ad0f4b 100644 --- a/translations/sl/LC_MESSAGES/messages.po +++ b/translations/sl/LC_MESSAGES/messages.po @@ -423,6 +423,18 @@ msgstr "najmanjše število pojavitev drevesa v korpusu" msgid "Association measures" msgstr "Mere povezovalnosti" +msgid "Complexity measures" +msgstr "Mere kompleksnosti" + +msgid "print maximum tree depth and mean dependency distance (MDD)" +msgstr "izpiše največjo globino drevesa in povprečno razdaljo odvisnosti (MDD)" + +msgid "Max depth" +msgstr "Največja globina" + +msgid "MDD" +msgstr "MDD" + #: templates/index.html:156 msgid "print MI, logDice and t-score" msgstr "izračun vrednosti MI, logDice in t-test"