Add KorAP-XML-CoNLL-U plugin
Change-Id: I45b2d5132790958efde209d0f93fe830912abb0d
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index 5da9493..c36c8a2 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -8,7 +8,7 @@
use List::Util qw!none uniq!;
# Minor version - may be patched from package.json
-our $VERSION = '0.48';
+our $VERSION = '0.49';
# Supported version of Backend API
our $API_VERSION = '1.0';
diff --git a/lib/Kalamar/Plugin/KorAPXML2CoNLLU.pm b/lib/Kalamar/Plugin/KorAPXML2CoNLLU.pm
new file mode 100644
index 0000000..d8cfae0
--- /dev/null
+++ b/lib/Kalamar/Plugin/KorAPXML2CoNLLU.pm
@@ -0,0 +1,14 @@
+package Kalamar::Plugin::KorAPXML2CoNLLU;
+use Mojo::Base 'Mojolicious::Plugin';
+use Mojo::Base -strict;
+sub register {
+ my ($plugin, $mojo) = @_;
+ my $script = `sh -c 'command -v conllu2korapxml'`;
+ if ($script ne '') {
+ # Add additional command path
+ push(@{$mojo->commands->namespaces}, __PACKAGE__);
+ return 1;
+ };
+ return 0;
+};
+1;
diff --git a/lib/Kalamar/Plugin/KorAPXML2CoNLLU/conllu2korapxml.pm b/lib/Kalamar/Plugin/KorAPXML2CoNLLU/conllu2korapxml.pm
new file mode 100644
index 0000000..f6eb0c3
--- /dev/null
+++ b/lib/Kalamar/Plugin/KorAPXML2CoNLLU/conllu2korapxml.pm
@@ -0,0 +1,15 @@
+package Kalamar::Plugin::KorAPXML2CoNLLU::conllu2korapxml;
+use Mojo::Base 'Mojolicious::Command';
+
+has description => 'Conversion of KorAP-XML CoNLL-U to KorAP-XML zips';
+has usage => sub {
+ return qx{conllu2korapxml --help};
+};
+
+sub run {
+ shift;
+ system('conllu2korapxml', @_);
+ return 1;
+};
+
+1;
diff --git a/lib/Kalamar/Plugin/KorAPXML2CoNLLU/korapxml2conllu.pm b/lib/Kalamar/Plugin/KorAPXML2CoNLLU/korapxml2conllu.pm
new file mode 100644
index 0000000..2ba8d63
--- /dev/null
+++ b/lib/Kalamar/Plugin/KorAPXML2CoNLLU/korapxml2conllu.pm
@@ -0,0 +1,15 @@
+package Kalamar::Plugin::KorAPXML2CoNLLU::korapxml2conllu;
+use Mojo::Base 'Mojolicious::Command';
+
+has description => 'Conversion of KorAP-XML zips to CoNLL-U';
+has usage => sub {
+ return qx{korapxml2conllu --help};
+};
+
+sub run {
+ shift;
+ system('korapxml2conllu', @_);
+ return 1;
+};
+
+1;