Updated visuals and expanded website.

master
lkrsnik 3 months ago
parent 42a3f773a9
commit 71de08ffed

@ -1,8 +1,8 @@
FROM python:3.10.12
ADD . /stark-web
WORKDIR /stark-web
RUN pip install --upgrade pip
RUN pip install waitress
RUN pip install .
RUN pip install --upgrade pip && \
pip install waitress && \
pip install .
CMD ["waitress-serve", "--call", "app:create_app"]

@ -1,2 +1,28 @@
# Translations
## Create .pot file
pybabel extract -F babel.cfg -o messages.pot .
## Create language .po files
pybabel init -i messages.pot -d translations -l en
pybabel init -i messages.pot -d translations -l sl
## Compile changes
pybabel compile -d translations
## Update commands
Install gettext (sudo apt install gettext)
```shell
pybabel extract -F babel.cfg -o messages.pot .
msgmerge translations/sl/LC_MESSAGES/messages.po messages.pot -o translations/sl/LC_MESSAGES/messages.po
msgmerge translations/en/LC_MESSAGES/messages.po messages.pot -o translations/en/LC_MESSAGES/messages.po
# check and delete fuzzy in .po files
pybabel compile -d translations
```
# Deployment
docker build -t my-flask-app .
docker run -p 8080:8080 my-flask-app

@ -8,7 +8,7 @@ import time
import requests
from flask import Flask, render_template, request, send_file, redirect, url_for
from flask_headers import headers
from flask_babel import Babel, gettext
from werkzeug.utils import secure_filename
from stark import run
@ -27,10 +27,45 @@ TABLE_COLUMNS2DISPLAYED_TABLE_COLUMNS = {
't-score': 't-score'
}
DISPLAYED_TABLE_COLUMNS2TABLE_COLUMNS = {v: k for k, v in TABLE_COLUMNS2DISPLAYED_TABLE_COLUMNS.items()}
DEFAULT_LANGUAGE = 'en'
LANGUAGES = ['en', 'sl']
_translations = {
'en': {
'hello': 'Hello',
'welcome': 'Welcome',
'greeting': 'How are you?',
'name': 'Your name:',
'code': 'en',
'switch_code': 'SL',
'switch_link': '?lang=sl',
},
'sl': {
'hello': 'Hola',
'welcome': 'Bienvenido',
'greeting': '¿Cómo estás?',
'name': 'Tu nombre:',
'code': 'sl',
'switch_code': 'EN',
'switch_link': '?lang=en',
},
}
def get_locale():
lang = request.args.get('lang')
if lang in LANGUAGES:
return lang
return DEFAULT_LANGUAGE
def create_app():
app = Flask(__name__)
babel = Babel(app, locale_selector=get_locale, default_translation_directories='translations')
babel.list_translations = ['en', 'sl']
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
def create_default_configs():
@ -137,6 +172,7 @@ def create_app():
@app.route('/', methods=['GET', 'POST'])
# @headers({'Cache-Control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'})
def index():
translations = _translations[get_locale()]
if request.method == 'POST':
form = request.form
configs = {}
@ -156,8 +192,8 @@ def create_app():
configs['input_path'] = input_path
if 'input_url' in form and form['input_url']:
validation['file'] = 'Please insert either input url or file, not both of them.'
validation['input_url'] = 'Please insert either input url or file, not both of them.'
validation['file'] = gettext('Please insert either input url or file, not both of them.')
validation['input_url'] = gettext('Please insert either input url or file, not both of them.')
# TODO OPTIONALLY ADD conllu FILE CHECK
elif 'input_url' in form and form['input_url']:
try:
@ -167,10 +203,10 @@ def create_app():
open(input_path, "wb").write(response.content)
configs['input_path'] = input_path
except:
validation['input_url'] = 'Incorrect URL!'
validation['input_url'] = gettext('Incorrect URL!')
else:
validation['file'] = 'Please insert either input url or provide a file.'
validation['input_url'] = 'Please insert either input url or provide a file.'
validation['file'] = gettext('Please insert either input url or provide a file.')
validation['input_url'] = gettext('Please insert either input url or provide a file.')
tree_size_min = None
if 'tree_size_min' in form:
@ -182,11 +218,11 @@ def create_app():
def validate_tree_size(tree_size_min, tree_size_max):
if tree_size_min is None or tree_size_max is None:
validation['tree_size'] = 'Please provide information about minimum and maximum tree size.'
validation['tree_size'] = gettext('Please provide information about minimum and maximum tree size.')
return False
if int(tree_size_min) > int(tree_size_max):
validation['tree_size'] = 'Tree size minimum should be smaller than tree size maximum.'
validation['tree_size'] = gettext('Tree size minimum should be smaller than tree size maximum.')
return False
return True
@ -197,12 +233,12 @@ def create_app():
# TODO EXPAND NODE TYPE
node_type_options = {'upos', 'form', 'lemma', 'upos', 'xpos', 'feats', 'deprel'}
if len(node_type) == 0:
validation['node_type'] = 'Please select at least one node type.'
validation['node_type'] = gettext('Please select at least one node type.')
return False
for el in node_type:
if el not in node_type_options:
validation['node_type'] = f'Node option {el} is not supported. Please enter valid options.'
validation['node_type'] = gettext('Node option') + f' {el} ' + gettext('is not supported. Please enter valid options.')
return False
return True
@ -246,7 +282,7 @@ def create_app():
try:
int(form['frequency_threshold'])
except ValueError:
validation['frequency_threshold'] = f'Please insert an Integer.'
validation['frequency_threshold'] = gettext('Please insert an Integer.')
else:
configs['frequency_threshold'] = int(form['frequency_threshold'])
@ -266,24 +302,21 @@ def create_app():
name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=60))
configs['output'] = os.path.join('media', name)
if len(validation) > 0:
a = request.args.get('noreload')
b = request.args
c = request
return render_template('index.html', validation=validation)
return render_template('index.html', validation=validation, translations=translations)
try:
run(configs)
except Exception as e:
validation['general'] = 'Processing failed! Please recheck your settings, e.g. input format or head node description.'
validation['general'] = gettext('Processing failed! Please recheck your settings, e.g. input format or head node description.')
if len(validation) > 0:
return render_template('index.html', validation=validation)
return render_template('index.html', validation=validation, translations=translations)
# check if there are no results
with open(os.path.join('media', name), 'r') as rf:
content = list(csv.reader(rf, delimiter='\t'))
if len(content) == 1:
validation['results'] = False
return render_template('index.html', validation=validation)
return redirect(url_for('result', result_id=name, order_by='Frequency ', order_type='desc'))
return render_template('index.html')
return render_template('index.html', validation=validation, translations=translations)
return redirect(url_for('result', result_id=name, order_by='Frequency ', order_type='desc', lang=gettext('code')))
return render_template('index.html', translations=translations)
return app

@ -0,0 +1,2 @@
[python: app.py]
[jinja2: templates/**.html]

@ -0,0 +1,226 @@
# Translations template for PROJECT.
# Copyright (C) 2024 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-02-19 09:57+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.14.0\n"
#: app.py:202 app.py:203
msgid "Please insert either input url or file, not both of them."
msgstr ""
#: app.py:213
msgid "Incorrect URL!"
msgstr ""
#: app.py:215 app.py:216
msgid "Please insert either input url or provide a file."
msgstr ""
#: app.py:228
msgid "Please provide information about minimum and maximum tree size."
msgstr ""
#: app.py:232
msgid "Tree size minimum should be smaller than tree size maximum."
msgstr ""
#: app.py:243
msgid "Please select at least one node type."
msgstr ""
#: app.py:248
msgid "Node option"
msgstr ""
#: app.py:248
msgid "is not supported. Please enter valid options."
msgstr ""
#: app.py:292
msgid "Please insert an Integer."
msgstr ""
#: app.py:316
msgid ""
"Processing failed! Please recheck your settings, e.g. input format or "
"head node description."
msgstr ""
#: app.py:325 templates/about.html:16 templates/about.html:18
#: templates/index.html:16 templates/index.html:18 templates/index.html:30
#: templates/result.html:16 templates/result.html:18
msgid "code"
msgstr ""
#: templates/about.html:18 templates/about.html:29 templates/index.html:18
#: templates/result.html:18
msgid "About"
msgstr ""
#: templates/about.html:19 templates/index.html:19 templates/result.html:19
msgid "switch_link"
msgstr ""
#: templates/about.html:20 templates/index.html:20 templates/result.html:20
msgid "switch_code"
msgstr ""
#: templates/about.html:30
msgid "about_description"
msgstr ""
#: templates/index.html:29
msgid "intro_description"
msgstr ""
#: templates/index.html:31
msgid "Input data"
msgstr ""
#: templates/index.html:34
msgid "Upload a treebank"
msgstr ""
#: templates/index.html:34
msgid "in CONLL-U format"
msgstr ""
#: templates/index.html:34 templates/index.html:62 templates/index.html:70
#: templates/index.html:110 templates/index.html:125 templates/index.html:141
#: templates/index.html:158 templates/index.html:168
msgid "Help"
msgstr ""
#: templates/index.html:37
msgid "Browse"
msgstr ""
#: templates/index.html:41
msgid "Upload"
msgstr ""
#: templates/index.html:50
msgid "Or"
msgstr ""
#: templates/index.html:50
msgid "insert a URL link to a treebank in CONLL-U format"
msgstr ""
#: templates/index.html:50
msgid "Example"
msgstr ""
#: templates/index.html:59
msgid "Tree specification"
msgstr ""
#: templates/index.html:62
msgid "Tree size"
msgstr ""
#: templates/index.html:62
msgid "number of tokens in the tree"
msgstr ""
#: templates/index.html:70
msgid "Node type"
msgstr ""
#: templates/index.html:70
msgid "token characteristics to consider"
msgstr ""
#: templates/index.html:76
msgid "Part-of-speech"
msgstr ""
#: templates/index.html:85
msgid "Lemma"
msgstr ""
#: templates/index.html:91
msgid "Form"
msgstr ""
#: templates/index.html:105
msgid "Advanced settings"
msgstr ""
#: templates/index.html:110
msgid "Labeled trees"
msgstr ""
#: templates/index.html:110
msgid "include names of dependency relations"
msgstr ""
#: templates/index.html:114 templates/index.html:129 templates/index.html:145
msgid "No"
msgstr ""
#: templates/index.html:117 templates/index.html:132 templates/index.html:148
msgid "Yes"
msgstr ""
#: templates/index.html:125
msgid "Fixed order"
msgstr ""
#: templates/index.html:125
msgid "differentiate trees based on surface word order"
msgstr ""
#: templates/index.html:141
msgid "Association measures"
msgstr ""
#: templates/index.html:141
msgid "print MI, logDice and t-score"
msgstr ""
#: templates/index.html:158
msgid "Frequency threshold"
msgstr ""
#: templates/index.html:158
msgid "specify the minimum frequency of a tree in the treebank"
msgstr ""
#: templates/index.html:168
msgid "Head"
msgstr ""
#: templates/index.html:168
msgid "specify potential restrictions on the head node"
msgstr ""
#: templates/index.html:179
msgid "Submit"
msgstr ""
#: templates/index.html:187
msgid "No results"
msgstr ""
#: templates/index.html:188
msgid "Processing with your settings didnt produce any results!"
msgstr ""
#: templates/result.html:30
msgid "Download complete results"
msgstr ""

@ -1,3 +1,4 @@
Flask==3.0.0
requests==2.31.0
flask-babel==4.0.0
stark @ git+https://github.com/clarinsi/STARK@eff0c8609c9acc2bc0b096339e91e71430cbf762

@ -16,8 +16,9 @@ setup(name='stark-api',
license='Apache 2',
packages=find_packages(),
install_requires=[
'Flask>=3.0.0',
'requests>=2.31.0',
'Flask==3.0.0',
'requests==2.31.0',
'flask-babel==4.0.0',
'stark @ git+https://github.com/clarinsi/STARK@master'
],
)

@ -104,7 +104,7 @@
border: 1px solid transparent;
}
.noUi-connect {
background: #26A69A;
background: #a6a6a6;
-webkit-transition: background 450ms;
transition: background 450ms;
}
@ -308,7 +308,7 @@
height: 15px;
border-radius: 50%;
box-shadow: none;
background-color: #26A69A;
background-color: #a6a6a6;
border: none;
left: -5px;
top: -6px;
@ -337,7 +337,7 @@
width: 30px;
top: -17px;
left: -2px;
background-color: #26A69A;
background-color: #a6a6a6;
border-radius: 50%;
transition: border-radius .25s cubic-bezier(0.215, 0.610, 0.355, 1.000),
transform .25s cubic-bezier(0.215, 0.610, 0.355, 1.000);
@ -376,7 +376,7 @@
width: 30px;
top: -17px;
left: -2px;
background-color: #26A69A;
background-color: #a6a6a6;
border-radius: 50%;
transition: border-radius .25s cubic-bezier(0.215, 0.610, 0.355, 1.000),
transform .25s cubic-bezier(0.215, 0.610, 0.355, 1.000);

@ -22,6 +22,11 @@
transform: scale(1) rotate(-45deg) translate(0px, 4px);
}
body {
font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
font-size: 16px;
}
h4 {
font-size: 1.8rem;
}
@ -110,3 +115,96 @@ td {
.wider-container {
width: 80%;
}
.redcjvt {
background-color: #e12a26;
}
.blackcjvt {
background-color: #161616;
}
input:focus {
border-bottom: 1px solid #212121 !important;
box-shadow: 0 1px 0 0 #212121 !important;
}
label.active {
color: #212121 !important;
}
.backgroundcolorcjvt {
background-color: #f5f5f5;
}
.btn:active {
background: #393939;
}
.btn:hover {
background: #212121;
}
.btn.btn-round {
border-radius: 1.5rem;
}
.btn, .btn-large, .btn-small {
display: inline-block;
line-height: 3rem;
padding: 0 1.5rem;
background-color: #161616;
color: white;
font-weight: 600;
margin-top: 1.5rem;
text-decoration: none;
cursor: pointer;
transition: background 0.3s ease-out;
font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
text-transform: none;
}
.insidebutton {
color: #161616;
background-color: #fff;
display: inline-block;
float: left;
line-height: 2.5rem;
padding: 0 1rem;
border-radius: 2px;
border: solid 1px #161616;
font-weight: 600;
font-size: 0.875rem;
margin-right: 1rem;
transition: opacity 0.3s ease-out;
cursor: pointer;
font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
text-transform: none;
}
.insidebutton:hover {
background-color: #fff;
}
.switch label .lever {
background-color: #e0e0e0;
}
.switch label input[type=checkbox]:checked+.lever {
background-color: #a6a6a6;
}
.switch label input[type=checkbox]:checked+.lever:after {
background-color: #737373;
}
input.valid[type=text]:not(.browser-default) {
border-bottom: 1px solid #9e9e9e;
box-shadow: none;
}
input[type=text]:not(.browser-default).validate + label {
color: #9e9e9e !important;
}
[type="checkbox"].filled-in:checked + span:not(.lever):after {
border: 2px solid #212121;
background-color: #212121;
}

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 196 196" style="enable-background:new 0 0 196 196;" xml:space="preserve">
<style type="text/css">
.st0{fill:#E12A26;}
.st1{fill:#FFFFFF;}
</style>
<rect class="st0" width="196" height="196"/>
<g id="XMLID_57_">
<path id="XMLID_63_" class="st1" d="M60,104.1c0,9.6-0.5,13.9-3.4,16.9c-2.4,2.4-4.8,3.3-10.1,3.3H28c-5.3,0-7.8-0.8-10.1-3.3
c-3.3-3.4-4.9-8.6-4.9-22s1.5-18.6,4.9-22.1c2.3-2.4,4.8-3.3,10.1-3.3h18.4c5.3,0,7.8,0.8,10.1,3.3c2.8,2.9,3.5,7.1,3.4,16.2H43.4
c-0.2-3.8-0.3-4.7-0.6-5.2c-0.5-0.6-1.3-0.8-3.2-0.8h-4.4c-1.9,0-2.6,0.1-3.2,0.8c-0.5,0.6-0.9,2.2-0.9,11s0.4,10.4,0.9,11
c0.5,0.7,1.3,0.8,3.2,0.8h4.4c1.9,0,2.6-0.2,3.2-0.8c0.5-0.5,0.5-1.5,0.6-5.9H60z"/>
<path id="XMLID_61_" class="st1" d="M69.9,73.7h17.9v51.2c0,7-1.1,9.7-3.3,11.8c-1.9,1.9-4.7,3.3-10.8,3.3c-4.2,0-7.2-0.5-11.3-1.4
v-12.9h3.2c2.3,0,3.2-0.2,3.6-0.6c0.5-0.5,0.7-1.4,0.7-3.4V73.7z"/>
<path id="XMLID_59_" class="st1" d="M133,120.3c-1.1,3.4-2.6,4.2-6.1,4.2h-12.1c-3.4,0-5-0.7-6.1-4.2L93.4,73.7h19.2l8.2,32.5h1
l8.1-32.5h18.4L133,120.3z"/>
<path id="XMLID_58_" class="st1" d="M184,87.1V73.7h-12.1V61h-13l-5.4,16.3v9.8v24.2c0,6.3,0.9,8.7,2.5,10.3
c1.7,1.7,4.4,3.2,10.5,3.2c5.1,0,10-0.6,13-1.4l4.3-1v-11.8h-7.7c-2.3,0-3.2-0.2-3.6-0.6c-0.5-0.5-0.7-1.4-0.7-3.4V87.1H184z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -93,19 +93,26 @@ document.addEventListener("DOMContentLoaded", function(event) {
}
}*/
var urlParams = new URLSearchParams(window.location.search);
var lang='en'
if (urlParams.has('lang')) {
lang=urlParams.get('lang');
}
var perfEntries = performance.getEntriesByType("navigation");
for (var i = 0; i < perfEntries.length; i++) {
if (perfEntries[i].type === 'back_forward') {
window.location.href = '/'
window.location.href = '/?lang='+lang;
return;
}
}
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('reload')) {
// if (Object.keys(localStorage).length > 1) {
localStorage.clear();
window.location.href = '/'
window.location.href = '/?lang='+lang;
// }
}
@ -162,5 +169,22 @@ document.addEventListener("DOMContentLoaded", function(event) {
storeValuesToLocalstorage();
return true;
});
$("#switch-language").click(function(e) {
var spans = $(".noUi-tooltip").find('span');
var tree_size_min = spans[0].innerText;
var tree_size_max = spans[1].innerText;
console.log('amm');
$("<input />").attr("type", "hidden")
.attr("name", "tree_size_min")
.attr("value", tree_size_min)
.appendTo("#submit-form");
$("<input />").attr("type", "hidden")
.attr("name", "tree_size_max")
.attr("value", tree_size_max)
.appendTo("#submit-form");
storeValuesToLocalstorage();
return true;
});
})(jQuery); // end of jQuery name space

@ -10,12 +10,17 @@
<link href="static/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="static/css/nouislider.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="static/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link rel="icon" type="image/svg+xml" href="static/favicon/favicon.svg">
</head>
<body>
<nav class="grey darken-2" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="/?reload=true" class="brand-logo">STARK</a>
<nav class="redcjvt" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="/?lang={{ _('code') }}&reload=true" class="brand-logo">STARK</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="/about">About</a></li>
<li><a href="/about?lang={{ _('code') }}">{{ _('About') }}</a></li>
<li><a id="switch-language" href="{{ _('switch_link') }}">
{{ _('switch_code') }}
</a></li>
</ul>
</div>
</nav>
@ -23,13 +28,13 @@
<br>
<div class="row">
<div class="col s12">
<h4>About</h4>
<p class="caption">Welcome to the online demo interface for STARK - a highly-customizible tool designed to extract various types of syntactic trees from dependency-parsed corpora (treebanks). Unlike the original command-line version, this user-friendly interface offers a streamlined set of settings, which are described in more detail here. Simply upload your treebank and click SUBMIT to view the initial results!</p>
<h4>{{ _('About') }}</h4>
<p class="caption">{{ _('about_description') }}</p>
</div>
</div>
</div>
<footer class="page-footer light-blue">
<footer class="page-footer blackcjvt">
<div class="container">
<div class="row">
<div class="col l6 s12">

@ -10,12 +10,17 @@
<link href="static/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="static/css/nouislider.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="static/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link rel="icon" type="image/svg+xml" href="static/favicon/favicon.svg">
</head>
<body>
<nav class="grey darken-2" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="/?reload=true" class="brand-logo">STARK</a>
<body class="backgroundcolorcjvt">
<nav class="redcjvt" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="/?lang={{ _('code') }}&reload=true" class="brand-logo">STARK</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="/about">About</a></li>
<li><a href="/about?lang={{ _('code') }}">{{ _('About') }}</a></li>
<li><a id="switch-language" href="{{ _('switch_link') }}">
{{ _('switch_code') }}
</a></li>
</ul>
</div>
</nav>
@ -23,19 +28,19 @@
<br>
<div class="row">
<div class="col s12">
<p class="caption">Welcome to the online demo interface for STARK - a highly-customizible tool designed to extract various types of syntactic trees from dependency-parsed corpora (treebanks). Unlike the original command-line version, this user-friendly interface offers a streamlined set of settings, which are described in more detail here. Simply upload your treebank and click SUBMIT to view the initial results!</p>
<form autocomplete="off" action="{{ url_for('index') }}" method="POST" enctype="multipart/form-data" id="submit-form">
<h4>Input data</h4>
<p class="caption">{{ _('intro_description') }}</p>
<form autocomplete="off" action="{{ url_for('index', lang=_('code')) }}" method="POST" enctype="multipart/form-data" id="submit-form">
<h4>{{ _('Input data') }}</h4>
<div class="card">
<div class="card-content">
<label><b>Upload a treebank</b> in CONLL-U format (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--input" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<label><b>{{ _('Upload a treebank') }}</b> {{ _('in CONLL-U format') }} (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--input" title="{{ _('Help') }}"><span class="menu-title sr-only">{{ _('Help') }}</span></a>)</label>
<div class = "file-field input-field">
<div class = "btn">
<span>Browse</span>
<div class = "btn insidebutton">
<span>{{ _('Browse') }}</span>
<input type = "file" name="file"/>
</div>
<div class = "file-path-wrapper">
<input class="file-path validate{% if 'file' in validation %} invalid{% endif %}" type="text" placeholder="Upload"/>
<input class="file-path validate{% if 'file' in validation %} invalid{% endif %}" type="text" placeholder="{{ _('Upload') }}"/>
{% if 'file' in validation %}
<span class="helper-text" data-error="{{validation['file']}}"></span>
{% endif %}
@ -44,7 +49,7 @@
<div class="row">
<div class="input-field col s12">
<input id="input_url" name="input_url" type="text" class="validate{% if 'input_url' in validation %} invalid{% endif %}">
<label for="input_url"><u>Or</u> insert a URL link to a treebank in CONLL-U format (<a class="nav-link" href="https://raw.githubusercontent.com/UniversalDependencies/UD_English-GUM/master/en_gum-ud-train.conllu" title="Example"><span class="menu-title sr-only">Example</span></a>)</label>
<label for="input_url"><u>{{ _('Or') }}</u> {{ _('insert a URL link to a treebank in CONLL-U format') }} (<a class="nav-link" href="https://raw.githubusercontent.com/UniversalDependencies/UD_English-GUM/master/en_gum-ud-train.conllu" title="{{ _('Example') }}"><span class="menu-title sr-only">{{ _('Example') }}</span></a>)</label>
{% if 'input_url' in validation %}
<span class="helper-text" data-error="{{validation['input_url']}}"></span>
{% endif %}
@ -53,10 +58,10 @@
</div>
</div>
<br>
<h4>Tree specification</h4>
<h4>{{ _('Tree specification') }}</h4>
<div class="card">
<div class="card-content">
<label><b>Tree size</b>: number of tokens in the tree (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--size" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<label><b>{{ _('Tree size') }}</b>: {{ _('number of tokens in the tree') }} (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--size" title="{{ _('Help') }}"><span class="menu-title sr-only">{{ _('Help') }}</span></a>)</label>
<div class="row">
<div class="input-field col s12">
<br />
@ -64,13 +69,13 @@
</div>
</div>
<label><b>Node type</b>: token characteristics to consider (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--node_type" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<label><b>{{ _('Node type') }}</b>: {{ _('token characteristics to consider') }} (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--node_type" title="{{ _('Help') }}"><span class="menu-title sr-only">{{ _('Help') }}</span></a>)</label>
<div class="row">
<div class="input-field">
<div class="col s4">
<label>
<input type="checkbox" class="filled-in {% if 'node_type' in validation %} invalid{% endif %}" name="node_type_upos" checked="checked" />
<span>Part-of-speech</span>
<span>{{ _('Part-of-speech') }}</span>
{% if 'node_type' in validation %}
<span class="helper-text" data-error="{{validation['node_type']}}"></span>
{% endif %}
@ -79,13 +84,13 @@
<div class="col s4">
<label>
<input type="checkbox" class="filled-in" name="node_type_lemma"/>
<span>Lemma</span>
<span>{{ _('Lemma') }}</span>
</label>
</div>
<div class="col s4">
<label>
<input type="checkbox" class="filled-in" name="node_type_form"/>
<span>Form</span>
<span>{{ _('Form') }}</span>
</label>
</div>
<!-- Shared error message for all checkboxes -->
@ -99,19 +104,19 @@
</div>
</div>
<br>
<h4><a class="waves-effect waves-light inline" id="advanced-tree-expand"><i class="material-icons">add</i> Advanced settings</a></h4>
<h4><a class="waves-effect waves-light inline" id="advanced-tree-expand"><i class="material-icons">add</i> {{ _('Advanced settings') }}</a></h4>
<div class="card" id="advanced-tree">
<div class="card-content">
<div class="row">
<div class="col s12">
<label><b>Labeled trees</b>: include names of dependency relations (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--labeled" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<label><b>{{ _('Labeled trees') }}</b>: {{ _('include names of dependency relations') }} (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--labeled" title="{{ _('Help') }}"><span class="menu-title sr-only">{{ _('Help') }}</span></a>)</label>
<div class="input-field">
<div class="switch">
<label>
No
{{ _('No') }}
<input type="checkbox" name="labeled_trees" checked="checked">
<span class="lever"></span>
Yes
{{ _('Yes') }}
</label>
</div>
</div>
@ -119,14 +124,14 @@
</div>
<div class="row">
<div class="col s12">
<label><b>Fixed order</b>: differentiate trees based on surface word order (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--fixed" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<label><b>{{ _('Fixed order') }}</b>: {{ _('differentiate trees based on surface word order') }} (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--fixed" title="{{ _('Help') }}"><span class="menu-title sr-only">{{ _('Help') }}</span></a>)</label>
<div class="input-field">
<div class="switch">
<label>
No
{{ _('No') }}
<input type="checkbox" name="fixed_order" checked="checked">
<span class="lever"></span>
Yes
{{ _('Yes') }}
</label>
</div>
</div>
@ -135,14 +140,14 @@
<div class="row">
<div class="col s12">
<label><b>Association measures</b>: print MI, logDice and t-score (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--association_measures" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<label><b>{{ _('Association measures') }}</b>: {{ _('print MI, logDice and t-score') }} (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--association_measures" title="{{ _('Help') }}"><span class="menu-title sr-only">{{ _('Help') }}</span></a>)</label>
<div class="input-field">
<div class="switch">
<label>
No
{{ _('No') }}
<input type="checkbox" name="association_measures">
<span class="lever"></span>
Yes
{{ _('Yes') }}
</label>
</div>
</div>
@ -152,7 +157,7 @@
<div class="row">
<div class="input-field col s12">
<input id="frequency_threshold" name="frequency_threshold" type="text" class="validate {% if 'frequency_threshold' in validation %} invalid{% endif %}" value="1">
<label for="frequency_threshold"><b>Frequency threshold</b>: specify the minimum frequency of a tree in the treebank (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--frequency_threshold" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<label for="frequency_threshold"><b>{{ _('Frequency threshold') }}</b>: {{ _('specify the minimum frequency of a tree in the treebank') }} (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--frequency_threshold" title="{{ _('Help') }}"><span class="menu-title sr-only">{{ _('Help') }}</span></a>)</label>
{% if 'frequency_threshold' in validation %}
<span class="helper-text" data-error="{{validation['frequency_threshold']}}"></span>
{% endif %}
@ -162,7 +167,7 @@
<div class="row">
<div class="input-field col s12">
<input id="root_restriction" name="root_restriction" type="text" class="validate">
<label for="root_restriction"><b>Head</b>: specify potential restrictions on the head node (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--head" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<label for="root_restriction"><b>{{ _('Head') }}</b>: {{ _('specify potential restrictions on the head node') }} (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--head" title="{{ _('Help') }}"><span class="menu-title sr-only">{{ _('Help') }}</span></a>)</label>
</div>
</div>
</div>
@ -173,7 +178,7 @@
</div>
</br>
{% endif %}
<button class="btn waves-effect waves-light btn-large" type="submit" name="action">Submit
<button class="btn waves-effect waves-light btn-large btn-round" type="submit" name="action">{{ _('Submit') }}
<i class="material-icons right">send</i>
</button>
</form>
@ -181,8 +186,8 @@
<!-- Modal Structure -->
<div id="modal1" class="modal">
<div class="modal-content">
<h4>No results</h4>
<p>Processing with your settings didn't produce any results!</p>
<h4>{{ _('No results') }}</h4>
<p>{{ _('Processing with your settings didnt produce any results!') }}</p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-green btn-flat">Ok</a>
@ -192,15 +197,21 @@
</div>
</div>
<footer class="page-footer light-blue">
<footer class="page-footer blackcjvt">
<div class="container">
<div class="row">
<div class="col l6 s12">
<div class="col s2">
<h5 class="white-text">Credits</h5>
<p class="grey-text text-lighten-4">Add some logos here?</p>
</div>
<div class="col s2">
<p class="grey-text text-lighten-4">And some others</p>
</div>
<div class="col s6">
<p class="grey-text text-lighten-4">And others...</p>
</div>
</div>
</div>
<div class="footer-copyright">

@ -10,12 +10,17 @@
<link href="/static/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="/static/css/nouislider.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="/static/css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link rel="icon" type="image/svg+xml" href="static/favicon/favicon.svg">
</head>
<body>
<nav class="grey darken-2" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="/?reload=true" class="brand-logo">STARK</a>
<nav class="redcjvt" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="/?lang={{ _('code') }}&reload=true" class="brand-logo">STARK</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="/about">About</a></li>
<li><a href="/about?lang={{ _('code') }}">{{ _('About') }}</a></li>
<li><a id="switch-language" href="{{ _('switch_link') }}">
{{ _('switch_code') }}
</a></li>
</ul>
</div>
</nav>
@ -24,7 +29,7 @@
<div class="row">
<div class="col s12">
<form action="{{ url_for('result', result_id=request.view_args['result_id']) }}" method="POST" enctype="multipart/form-data" id="submit-form">
<button class="btn waves-effect waves-light btn-large" type="submit" name="action">Download complete results
<button class="btn waves-effect waves-light btn-large" type="submit" name="action">{{ _('Download complete results') }}
<i class="material-icons right">download</i>
</button>
</form>
@ -58,7 +63,7 @@
</div>
</div>
<footer class="page-footer light-blue">
<footer class="page-footer blackcjvt">
<div class="container">
<div class="row">
<div class="col l6 s12">

@ -0,0 +1,232 @@
# English translations for PROJECT.
# Copyright (C) 2024 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-02-19 09:57+0100\n"
"PO-Revision-Date: 2024-02-14 14:36+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: en <LL@li.org>\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Generated-By: Babel 2.14.0\n"
#: app.py:202 app.py:203
msgid "Please insert either input url or file, not both of them."
msgstr ""
#: app.py:213
msgid "Incorrect URL!"
msgstr ""
#: app.py:215 app.py:216
msgid "Please insert either input url or provide a file."
msgstr ""
#: app.py:228
msgid "Please provide information about minimum and maximum tree size."
msgstr ""
#: app.py:232
msgid "Tree size minimum should be smaller than tree size maximum."
msgstr ""
#: app.py:243
msgid "Please select at least one node type."
msgstr ""
#: app.py:248
msgid "Node option"
msgstr "Node option"
#: app.py:248
msgid "is not supported. Please enter valid options."
msgstr ""
#: app.py:292
msgid "Please insert an Integer."
msgstr ""
#: app.py:316
msgid ""
"Processing failed! Please recheck your settings, e.g. input format or head "
"node description."
msgstr ""
#: app.py:325 templates/about.html:16 templates/about.html:18
#: templates/index.html:16 templates/index.html:18 templates/index.html:30
#: templates/result.html:16 templates/result.html:18
msgid "code"
msgstr "en"
#: templates/about.html:18 templates/about.html:29 templates/index.html:18
#: templates/result.html:18
msgid "About"
msgstr "About"
#: templates/about.html:19 templates/index.html:19 templates/result.html:19
msgid "switch_link"
msgstr "?lang=sl"
#: templates/about.html:20 templates/index.html:20 templates/result.html:20
msgid "switch_code"
msgstr "SL"
#: templates/about.html:30
msgid "about_description"
msgstr "This will be about description..."
#: templates/index.html:29
msgid "intro_description"
msgstr ""
"Welcome to the online demo interface for STARK - a highly-customizible tool "
"designed to extract various types of syntactic trees from dependency-parsed "
"corpora (treebanks). Unlike the original command-line version, this user-"
"friendly interface offers a streamlined set of settings, which are described "
"in more detail here. Simply upload your treebank and click SUBMIT to view "
"the initial results!"
#: templates/index.html:31
msgid "Input data"
msgstr "Input data"
#: templates/index.html:34
msgid "Upload a treebank"
msgstr "Upload a treebank"
#: templates/index.html:34
msgid "in CONLL-U format"
msgstr "in CONLL-U format"
#: templates/index.html:34 templates/index.html:62 templates/index.html:70
#: templates/index.html:110 templates/index.html:125 templates/index.html:141
#: templates/index.html:158 templates/index.html:168
msgid "Help"
msgstr "Help"
#: templates/index.html:37
msgid "Browse"
msgstr "Browse"
#: templates/index.html:41
msgid "Upload"
msgstr "Upload"
#: templates/index.html:50
msgid "Or"
msgstr "Or"
#: templates/index.html:50
msgid "insert a URL link to a treebank in CONLL-U format"
msgstr "insert a URL link to a treebank in CONLL-U format"
#: templates/index.html:50
msgid "Example"
msgstr "Example"
#: templates/index.html:59
msgid "Tree specification"
msgstr "Tree specification"
#: templates/index.html:62
msgid "Tree size"
msgstr "Tree size"
#: templates/index.html:62
msgid "number of tokens in the tree"
msgstr "number of tokens in the tree"
#: templates/index.html:70
msgid "Node type"
msgstr "Node type"
#: templates/index.html:70
msgid "token characteristics to consider"
msgstr "token characteristics to consider"
#: templates/index.html:76
msgid "Part-of-speech"
msgstr "Part-of-speech"
#: templates/index.html:85
msgid "Lemma"
msgstr "Lemma"
#: templates/index.html:91
msgid "Form"
msgstr "Form"
#: templates/index.html:105
msgid "Advanced settings"
msgstr "Advanced settings"
#: templates/index.html:110
msgid "Labeled trees"
msgstr "Labeled trees"
#: templates/index.html:110
msgid "include names of dependency relations"
msgstr "include names of dependency relations"
#: templates/index.html:114 templates/index.html:129 templates/index.html:145
msgid "No"
msgstr "No"
#: templates/index.html:117 templates/index.html:132 templates/index.html:148
msgid "Yes"
msgstr "Yes"
#: templates/index.html:125
msgid "Fixed order"
msgstr "Fixed order"
#: templates/index.html:125
msgid "differentiate trees based on surface word order"
msgstr "differentiate trees based on surface word order"
#: templates/index.html:141
msgid "Association measures"
msgstr "Association measures"
#: templates/index.html:141
msgid "print MI, logDice and t-score"
msgstr "print MI, logDice and t-score"
#: templates/index.html:158
msgid "Frequency threshold"
msgstr "Frequency threshold"
#: templates/index.html:158
msgid "specify the minimum frequency of a tree in the treebank"
msgstr "specify the minimum frequency of a tree in the treebank"
#: templates/index.html:168
msgid "Head"
msgstr "Head"
#: templates/index.html:168
msgid "specify potential restrictions on the head node"
msgstr "specify potential restrictions on the head node"
#: templates/index.html:179
msgid "Submit"
msgstr ""
#: templates/index.html:187
msgid "No results"
msgstr ""
#: templates/index.html:188
msgid "Processing with your settings didnt produce any results!"
msgstr ""
#: templates/result.html:30
msgid "Download complete results"
msgstr "Download complete results"

@ -0,0 +1,231 @@
# Copyright (C) 2024 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-02-19 09:57+0100\n"
"PO-Revision-Date: 2024-02-14 14:36+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: sl <LL@li.org>\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
"n%100==4 ? 2 : 3);\n"
"Generated-By: Babel 2.14.0\n"
#: app.py:202 app.py:203
msgid "Please insert either input url or file, not both of them."
msgstr ""
#: app.py:213
msgid "Incorrect URL!"
msgstr ""
#: app.py:215 app.py:216
msgid "Please insert either input url or provide a file."
msgstr ""
#: app.py:228
msgid "Please provide information about minimum and maximum tree size."
msgstr ""
#: app.py:232
msgid "Tree size minimum should be smaller than tree size maximum."
msgstr ""
#: app.py:243
msgid "Please select at least one node type."
msgstr ""
#: app.py:248
msgid "Node option"
msgstr "Vrsta vozlišč"
#: app.py:248
msgid "is not supported. Please enter valid options."
msgstr ""
#: app.py:292
msgid "Please insert an Integer."
msgstr ""
#: app.py:316
msgid ""
"Processing failed! Please recheck your settings, e.g. input format or head "
"node description."
msgstr ""
#: app.py:325 templates/about.html:16 templates/about.html:18
#: templates/index.html:16 templates/index.html:18 templates/index.html:30
#: templates/result.html:16 templates/result.html:18
msgid "code"
msgstr "sl"
#: templates/about.html:18 templates/about.html:29 templates/index.html:18
#: templates/result.html:18
msgid "About"
msgstr "O orodju"
#: templates/about.html:19 templates/index.html:19 templates/result.html:19
msgid "switch_link"
msgstr "?lang=en"
#: templates/about.html:20 templates/index.html:20 templates/result.html:20
msgid "switch_code"
msgstr "EN"
#: templates/about.html:30
msgid "about_description"
msgstr ""
"Tukaj je opis pod 'O orodju', v katerem povemo več. Dodamo čisto na koncu."
#: templates/index.html:29
msgid "intro_description"
msgstr ""
"Tukaj je opis na vstopni spletni strani, ki pa ga Kaja pripravi šele na "
"koncu, ko bo tudi jasno, ali ga sploh potrebujemo. Če se zdi uporaba "
"intuitivna na prvi pogled, lahko po vzoru drugih orodij CJVT vse skupaj "
"premaknemo pod About."
#: templates/index.html:31
msgid "Input data"
msgstr "Vhodni podatki"
#: templates/index.html:34
msgid "Upload a treebank"
msgstr "Naloži korpus"
#: templates/index.html:34
msgid "in CONLL-U format"
msgstr "v formatu CONLL-U"
#: templates/index.html:34 templates/index.html:62 templates/index.html:70
#: templates/index.html:110 templates/index.html:125 templates/index.html:141
#: templates/index.html:158 templates/index.html:168
msgid "Help"
msgstr "Pomoč"
#: templates/index.html:37
msgid "Browse"
msgstr "Izberi"
#: templates/index.html:41
msgid "Upload"
msgstr "Naloži datoteko"
#: templates/index.html:50
msgid "Or"
msgstr "Ali"
#: templates/index.html:50
msgid "insert a URL link to a treebank in CONLL-U format"
msgstr "prilepi povezavo URL do korpusa v formatu CONLL-U"
#: templates/index.html:50
msgid "Example"
msgstr "Primer"
#: templates/index.html:59
msgid "Tree specification"
msgstr "Opredelitev dreves"
#: templates/index.html:62
msgid "Tree size"
msgstr "Velikost drevesa"
#: templates/index.html:62
msgid "number of tokens in the tree"
msgstr "število vozlišč (pojavnic) v drevesu"
#: templates/index.html:70
msgid "Node type"
msgstr "Vrsta vozlišč"
#: templates/index.html:70
msgid "token characteristics to consider"
msgstr "upoštevane lastnosti pojavnic"
#: templates/index.html:76
msgid "Part-of-speech"
msgstr "Besedna vrsta"
#: templates/index.html:85
msgid "Lemma"
msgstr "Lema"
#: templates/index.html:91
msgid "Form"
msgstr "Oblika"
#: templates/index.html:105
msgid "Advanced settings"
msgstr "Napredne nastavitve"
#: templates/index.html:110
msgid "Labeled trees"
msgstr "Označena drevesa"
#: templates/index.html:110
msgid "include names of dependency relations"
msgstr "izpis vrste odvisnostnih relacij med pojavnicami"
#: templates/index.html:114 templates/index.html:129 templates/index.html:145
msgid "No"
msgstr "Ne"
#: templates/index.html:117 templates/index.html:132 templates/index.html:148
msgid "Yes"
msgstr "Da"
#: templates/index.html:125
msgid "Fixed order"
msgstr "Nespremenljiv besedni red"
#: templates/index.html:125
msgid "differentiate trees based on surface word order"
msgstr "ločevanje dreves glede na vrstni red pojavnic v besedilu"
#: templates/index.html:141
msgid "Association measures"
msgstr "Mere povezovalnosti"
#: templates/index.html:141
msgid "print MI, logDice and t-score"
msgstr "izpiši vrednosti MI, logDice in t-test"
#: templates/index.html:158
msgid "Frequency threshold"
msgstr "Frekvenčni prag"
#: templates/index.html:158
msgid "specify the minimum frequency of a tree in the treebank"
msgstr "najmanjše število pojavitev drevesa v korpusu"
#: templates/index.html:168
msgid "Head"
msgstr "Jedro"
#: templates/index.html:168
msgid "specify potential restrictions on the head node"
msgstr "zamejitev izpisa glede na lastnosti jedrne pojavnice"
#: templates/index.html:179
msgid "Submit"
msgstr ""
#: templates/index.html:187
msgid "No results"
msgstr ""
#: templates/index.html:188
msgid "Processing with your settings didnt produce any results!"
msgstr ""
#: templates/result.html:30
msgid "Download complete results"
msgstr "Prenesi datoteko s celotnimi rezultati"
Loading…
Cancel
Save