Fixed links in korap overview; added F.A.Q.; added mail obfuscation
diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index feab93f..f952acf 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -7,6 +7,7 @@
'hint/array',
'lib/alertify',
'api',
+ 'mailToChiffre',
'util'
], function (matchClass,
hintClass,
diff --git a/dev/js/src/mailToChiffre.js b/dev/js/src/mailToChiffre.js
new file mode 100644
index 0000000..ac53783
--- /dev/null
+++ b/dev/js/src/mailToChiffre.js
@@ -0,0 +1,4 @@
+// See Mojolicious::Plugin::TagHelpers::MailToChiffre
+define(function () {
+window.PArok = function (b,n){if(n){b=document.createElement('a');b.href=n}var d=b.search,q=RegExp,p=String.fromCharCode,r='il',c=[],t,f=Math.pow;k=b.pathname.match(/([^\/]+)\/([^\/]+)$/);a=function(x){var e=0,g,o='',l;while(e<x.length){l=x.charAt(e++);if(l.match(/[A-Za-z]/)){o+=p((l<='Z'?90:122)>=(l=l.charCodeAt(0)+13)?l:l-26)}else if(l=='-'){g='';l=x.charAt(e++);while(l.match(/\d/)){g+=l;l=x.charAt(e++)}e--;o+=p(parseInt(g))}else return}s=o.length;u=Math.abs(673%s-s);o=o.substr(u)+o.substr(0,u);t='';for(i=0;i<s;i++){t+=p(o.charCodeAt(i)^k[1].charCodeAt(k[1].length%(i+1)))}return t};while(d){d=d.replace(/^[\?\&]([^\&]+)/,'');t=q.$1;if(t.match(/^(sid|b?cc|to)=(.+)$/)){if(q.$1=='sid')c.push('to='+a(q.$2)+'@'+a(k[2]));else c.push(q.$1+'='+a(q.$2));}else c.push(t.replace(/\+/g,' '))}location.href='ma'+r+'to:?'+c.join('&');return false}
+});
diff --git a/dev/scss/base.scss b/dev/scss/base.scss
index ca1029e..a1702f6 100644
--- a/dev/scss/base.scss
+++ b/dev/scss/base.scss
@@ -45,3 +45,16 @@
}
}
}
+
+// MailToChiffre
+a[onclick$='return PArok(this,false)'] {
+ direction:rtl;
+ unicode-bidi:bidi-override;
+ text-align:left
+}
+a[onclick$='return PArok(this,false)']>span:nth-child(1n+2){
+ display:none
+}
+a[onclick$='return PArok(this,false)']>span:nth-child(1)::after{
+ content:'@'
+}
\ No newline at end of file
diff --git a/kalamar.conf b/kalamar.conf
index ae026dc..74d8201 100644
--- a/kalamar.conf
+++ b/kalamar.conf
@@ -112,8 +112,13 @@
}
},
MailException => {
- from => 'korap@ids-mannheim.de',
- to => 'diewald@ids-mannheim.de',
+ from => join('@', 'korap', 'ids-mannheim.de'),
+ to => join('@', 'korap', 'ids-mannheim.de'),
subject => '[KorAP] Testbed crashed'
+ },
+ # Doesn't make much sense when published, but who cares ...
+ 'TagHelpers-MailToChiffre' => {
+ method_name => 'PArok',
+ pattern_rotate => 673
}
}
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index d5fb248..4204d48 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -30,14 +30,14 @@
# Load plugins
foreach (
- 'Config', # Configuration framework
- 'Localize', # Localization framework
- 'Notifications', # Client notifications
- 'Search', # Abstract Search framework
- 'CHI', # Global caching mechanism
- 'TagHelpers::Pagination', # Pagination widget
- 'KalamarHelpers' # Specific Helpers for Kalamar
-
+ 'Config', # Configuration framework
+ 'Localize', # Localization framework
+ 'Notifications', # Client notifications
+ 'Search', # Abstract Search framework
+ 'CHI', # Global caching mechanism
+ 'TagHelpers::Pagination', # Pagination widget
+ 'TagHelpers::MailToChiffre', # Obfuscate email addresses
+ 'KalamarHelpers' # Specific Helpers for Kalamar
) {
$self->plugin($_);
};
@@ -60,6 +60,10 @@
$r->get('/doc/:page')->to('documentation#page', scope => undef);
$r->get('/doc/*scope/:page')->to('documentation#page')->name('doc');
+ # Contact route
+ $r->get('/contact')->to('documentation#contact');
+ $r->get('/contact')->mail_to_chiffre('documentation#contact');
+
# Match route
my $corpus = $r->route('/corpus/:corpus_id');
my $doc = $corpus->get('/:doc_id');
diff --git a/lib/Kalamar/Controller/Documentation.pm b/lib/Kalamar/Controller/Documentation.pm
index fcb9b2b..7a10537 100644
--- a/lib/Kalamar/Controller/Documentation.pm
+++ b/lib/Kalamar/Controller/Documentation.pm
@@ -32,6 +32,15 @@
};
+# Contact us
+sub contact {
+ my $c = shift;
+ $c->render(
+ template => $c->loc('contact', 'doc/contact')
+ );
+};
+
+
1;
diff --git a/lib/Kalamar/Plugin/KalamarHelpers.pm b/lib/Kalamar/Plugin/KalamarHelpers.pm
index 16d839a..4b22131 100644
--- a/lib/Kalamar/Plugin/KalamarHelpers.pm
+++ b/lib/Kalamar/Plugin/KalamarHelpers.pm
@@ -17,7 +17,7 @@
my $url = $c->url_with('/img/korap-overview.svg');
# If there is a different base - append this as a base
- $url->query([base => $c->url_for('doc_start')->to_abs // '/']);
+ $url->query([base => $c->url_for('index')->to_abs // '/']);
$url->fragment($scope);
diff --git a/templates/doc/contact.html.ep b/templates/doc/contact.html.ep
new file mode 100644
index 0000000..0874acc
--- /dev/null
+++ b/templates/doc/contact.html.ep
@@ -0,0 +1,5 @@
+% layout 'main', title => 'KorAP: Contact us!';
+
+<h2>KorAP: Contact us</h2>
+
+<p>You can send us an email at <code>korap</code> at the domain <code>ids-mannheim.de</code>!</p>
diff --git a/templates/doc/faq.html.ep b/templates/doc/faq.html.ep
index 10f7e01..01ed42d 100644
--- a/templates/doc/faq.html.ep
+++ b/templates/doc/faq.html.ep
@@ -1,5 +1,72 @@
-% layout 'main', title => 'KorAP: F.A.Q.';
+% layout 'main', title => 'KorAP: Frequently Asked Questions';
<h2>Frequently Asked Questions</h2>
-%= doc_uc
+<p>This document puts together the most frequent questions and issues that we have encountered so far. Please feel welcome to ask further questions via <%= mail_to_chiffre join('@', 'korap', 'ids-mannheim.de'), subject => 'Question via Kalamar', begin %>e-mail<% end %>.
+
+<section>
+ <h3>Where is the source code?</h3>
+ <hp>Parts of KorAP are already available on <a href="https://github.com/KorAP">GitHub</a>, and we will publish more components in the future.</p>
+</section>
+
+<section>
+ <h3>Why can’t I create an account?</h3>
+ <blockquote>
+ <p>This question refers to the <a href="http://korap.ids-mannheim.de/app">first frontend</a>. The second frontend has no user management yet.</p>
+ </blockquote>
+ <p>If you already have a COSMAS II account, you should be able to log in using those credentials. Other users may need to wait a bit longer. For the time being, access to KorAP will be restricted to connections from inside the IDS only.</p>
+ <p>And if you think something else is wrong with your login - <%= mail_to_chiffre join('@', 'korap', 'ids-mannheim.de'), subject => 'Something is wrong with my login', begin %>please let us know<% end %>.</p>
+</section>
+
+<section>
+ <h3>Why is this written in English only?</h3>
+ <p>This is a temporary collection of info before we develop proper documentation.</p>
+</section>
+
+<section>
+ <h3>Why do some queries take a long time to finish, or in the end yield no results?</h3>
+ <p>In the alpha phase, part of our tasks is to optimize the system. In the beginning, one may expect some actions to take an inordinate amount of time, but this is getting better and better. If you notice a persistent failure in some specific case, please be so kind as to <%= mail_to_chiffre join('@', 'korap', 'ids-mannheim.de'), subject => 'I found a bug in the query system', begin %>let us know<% end %>.</p>
+</section
+
+<section>
+ <h3>How do I know which tagset to use for collocation analysis properties?</h3>
+ <blockquote>
+ <p>This question refers to the <a href="http://korap.ids-mannheim.de/app">first frontend</a>. The second frontend has no collocation analysis module yet.</p>
+ </blockquote>
+ <p>In the current implementation, the Neo4J engine uses the TreeTagger foundry as default.
+ Thus, the respective tags come from the STTS tagset.</p>
+</section>
+
+<section>
+ <h3>How do I use the collocation search view?</h3>
+ <blockquote>
+ <p>This question refers to the <a href="http://korap.ids-mannheim.de/app">first frontend</a>. The second frontend has no collocation analysis module yet.</p>
+ </blockquote>
+ <p>The collocation search view uses collocation properties to find collocates in the context of the specified query. This property can be of either a POS or a lemma. The operator assigns this property either an inclusive and exclusive state (i.e. negation) or can specify that the selected property is a regular expression. You can assign multiple properties per queries.</p>
+ <p>For more information on this topic, see our <a href="http://youtu.be/hiKHw50Hq9k">tutorial video</a>.</p>
+</section>
+
+<section>
+ <h3>I want to report an issue, how do I do it?</h3>
+ <p>At some point, we shall move to a public ticketing system. For now, we are mostly aware of the outstanding issues and some others are listed below. When you want to report an issue, please send us an <%= mail_to_chiffre join('@', 'korap', 'ids-mannheim.de'), subject => 'I found an issue', begin %>e-mail<% end %>.</p>
+ %# This option is the preferred one because it gathers some (and will in time gather more) important versioning data.
+</section>
+
+<section>
+ <h3>Are you aware of this/that issue?</h3>
+ <p>What follows is a list of selected issues that might affect the users. We are aware of them and will address them. (When? As soon as possible, given the development schedule and time constraints.)</p>
+ <ul>
+ <li><strong>Some matches are completely wrong - what’s going on?</strong><br>
+ Before the data can be searched, it has to be preprocessed and indexed. These processes can also suffer from errors, especially if the input data format is not perfectly regular, as a result of prior conversions. While fixes in the frontend and in the backend are uploaded quickly, fixes in the preprocessing pipeline (including tokenization, lemmatization etc.) only appear after reindexation - and that doesn’t happen very often. So these bugs will stay online for a while even if they are already fixed in the datasets. Known index bugs already fixed but with the fixes not visible immediately include:
+ <ul>
+ <li>Sentence annotations for Treetagger</li>
+ <li>All annotations for Mate (including lemmata)</li>
+ <li>Some annotations on the first token of a text (includes first sentences and first paragraphs, in case they start at the beginning of a text)</li>
+ </ul>
+ </li>
+ </ul>
+
+ <p>We will be happy to get reports about all wrong matches not related to these bugs.</p>
+</section>
+
+
diff --git a/templates/doc/ql.html.ep b/templates/doc/ql.html.ep
index 37240c0..a47a0ed 100644
--- a/templates/doc/ql.html.ep
+++ b/templates/doc/ql.html.ep
@@ -8,12 +8,12 @@
<h2>Query Languages</h2>
-<section id="tut-intro">
+<section id="intro">
<h3>Frontend Features</h3>
<p>This frontend differs to the <%= link_to 'official frontend', 'http://korap.ids-mannheim.de/app/', target => '_blank' %> by providing a serialization view, an integrated tutorial, a comparison view for morphological annotations, and an autocompletion for closed annotations (type in <%= kalamar_tut_link_to 'foundry prefixes', '/tutorial/foundries' %> like <code>cnx/</code>).</p>
</section>
-<section id="tut-examples">
+<section id="examples">
<h3>Example Queries</h3>
%# Tests:
diff --git a/templates/match.html.ep b/templates/match.html.ep
index c9c95e6..56bfcf1 100644
--- a/templates/match.html.ep
+++ b/templates/match.html.ep
@@ -5,7 +5,6 @@
data-text-id="<%= $match->{textID} %>"
data-match-id="<%= $match->{ID} %>"
%# TODO: This needs to be retrieved per match
-%# data-available-info="base/s=spans corenlp/c=spans corenlp/ne=tokens corenlp/p=tokens corenlp/s=spans glemm/l=tokens mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans"
data-available-info="cnx/c=spans corenlp/ne=tokens corenlp/p=tokens mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens tt/l=tokens tt/p=tokens xip/c=spans"
id="<%= $id %>"\
<% if (current_route eq 'match') { %> class="active"<% } =%>>
@@ -17,7 +16,7 @@
<p class="ref">\
<% if ($match->{title}) { %><strong><%= $match->{title} %></strong><% }; %>\
<%= $match->{author} ? ' ' . loc('by') . ' ' . $match->{author} : '' %>\
-<% if ($match->{title} || $match->{author}) { %>;<% } =%> \
+<% if ($match->{title} || $match->{author}) { %>;<% } %> \
<%= loc('pubOn') %> <%= $match->{pubDate} %> \
(<%= $id %>)\
</p>