Improved hint menu for Schreibgebrauch
diff --git a/dev/js/src/hint/array.js b/dev/js/src/hint/array.js
index 760f2ba..529d2b6 100644
--- a/dev/js/src/hint/array.js
+++ b/dev/js/src/hint/array.js
@@ -159,11 +159,32 @@
var sgbSttsArray = sttsArray.slice(0);
sgbSttsArray.splice(17,0, ["NNE", "NNE", "Normal Nomina with Named Entity"]);
+/* As KorAP currently doesn't support these tags, they are not part of the set
sgbSttsArray.push(
["_KOMMA", "_KOMMA", "Comma"],
["_SONST", "_SONST", "Intrasentential Punctuation Mark"],
["_ENDE", "_ENDE", "Punctuation Mark at the end of the Sentence"]
);
+*/
+/*
+"ADR", // Adressierung ???
+"ADVART", "Adverb with Article"
+"AW", // Aktionswort ???
+"AWIND", // Aktionswort-Indikator ???
+"EMOASC", "Emoticon ('ASCII' type)",
+"EMOIMG", "Emoticon (\'image' type )",
+"ERRAW", // falsch abgetrennter Wortteil ???
+"ERRTOK", "Tokenisation Error"
+"HST", "Hashtag"
+"KOUSPPER", "Subordinating Conjunction (with Sentence) with Personal Pronoun"
+"ONO", // Onomatopoetikon ???
+"PPERPPER", "Personal Pronoun with Personal Pronoun"
+"URL", "Uniform Resource Locator"
+"VAPPER", "Auxiliary Finite Verb with Personal Pronoun"
+"VMPPER", "Modal Fintite Verb with Personal Pronoun"
+"VVPPER", "Finite Verb with Personal Pronoun"
+*/
+
define(function () {
var obj = {
diff --git a/t/kalamar_user_client.t b/t/kalamar_user_client.t
new file mode 100644
index 0000000..4c79c53
--- /dev/null
+++ b/t/kalamar_user_client.t
@@ -0,0 +1,92 @@
+use Mojo::Base -strict;
+use Test::Mojo;
+use Test::More;
+use Mojolicious::Lite;
+use lib 'lib', '../lib';
+
+my $t = Test::Mojo->new;
+my $app = $t->app;
+
+# Add additional plugin path
+push(@{app->plugins->namespaces}, 'Kalamar::Plugin');
+
+plugin 'CHI' => {
+ user => {
+ driver => 'Memory',
+ global => 1
+ }
+};
+
+plugin 'KalamarUser' => {
+ api => 'http://10.0.10.51:7070/api/v0.1/'
+};
+
+post '/acct/login' => sub {
+ my $c = shift;
+ my $user = $c->param('user');
+ my $pwd = $c->param('pwd');
+ return $c->redirect_to('index') if $c->user->login($user, $pwd);
+ return $c->redirect_to;
+} => 'login';
+
+
+get '/' => sub {
+ my $c = shift;
+ my $details = $c->user->get('details');
+ return $c->redirect_to('login') unless $details;
+ $c->render(json => $details);
+} => 'index';
+
+
+get '/acct/settings' => sub {
+ my $c = shift;
+ my $settings = $c->user->get('settings');
+ return $c->redirect_to('login') unless $settings;
+ $c->render(json => $settings);
+};
+
+
+$t->get_ok('/')
+ ->status_is(302)
+ ->header_is('location', '/acct/login');
+
+# Tests
+$t->post_ok('/acct/login' => {} => form => {
+ user => 'kustvakt',
+ pwd => 'kustvakt2015'
+})
+ ->status_is(302)
+ ->header_is('location', '/');
+
+$t->get_ok('/')
+ ->status_is(200)
+ ->json_is('/country', 'Germany')
+ ->json_is('/firstName', 'Kustvakt')
+ ->json_is('/lastName', 'KorAP')
+ ->json_is('/email', 'kustvakt@ids-mannheim.de')
+ ;
+
+$t->get_ok('/acct/settings')
+ ->status_is(200)
+ ->json_is('/queryLanguage', 'COSMAS2')
+ ->json_is('/constFoundry', 'mate')
+ ->json_is('/relFoundry', 'mate')
+ ->json_is('/lemmaFoundry', 'tt')
+ ->json_is('/POSFoundry', 'tt')
+ ;
+
+done_testing;
+
+__END__
+
+# print Dumper $user->user_query;
+# print Dumper $user->get_collection_stat('242eea9442fcba4e4f51e4ff292eebe2aca4e7f3');
+# print Dumper $user->user_settings;
+print Dumper $user->collections;
+
+#print "\n";
+
+# my $x = 'ZGU0ZTllNTFkYzc3M2VhZmViYzdkYWE2ODI5NDc3NTk4NGQ1YThhOTMwOTNhOWYxNWMwN2M3Y2YyZmE3N2RlNQ==';
+# print b($x)->b64_decode,"\n";
+
+my $user = Kalamar::User->new->authorize_jwt('kustvakt', 'kustvakt2015');