Minor changes for code publication and persistant method to VC
diff --git a/dev/demo/alldemo.js b/dev/demo/alldemo.js
index 547a09f..1bc0ddf 100644
--- a/dev/demo/alldemo.js
+++ b/dev/demo/alldemo.js
@@ -416,6 +416,114 @@
]
};
+var queryExample = {"wrap":{"layer":"orth","match":"match:eq","foundry":"opennlp","key":"Baum","@type":"korap:term"},"@type":"korap:token"};
+
+queryExample = {
+ "@context" : "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
+ "collection" : {
+ "@type" : "koral:doc",
+ "key" : "pubDate",
+ "value" : "2005-05-25",
+ "type" : "type:date",
+ "match" : "match:geq"
+ },
+ "query" : {}
+};
+
+queryExample = {
+ "@type" : "koral:docGroup",
+ "operation" : "operation:and",
+ "operands" : [{
+ "@type":"koral:doc",
+ "key":"title",
+ "match":"match:eq",
+ "value":"Der Birnbaum",
+ "type":"type:string"
+ },{
+ "@type":"koral:doc",
+ "key":"pubPlace",
+ "match":"match:eq",
+ "value":"Mannheim",
+ "type":"type:string"
+ }
+ ]
+ };
+
+queryExample = {
+ "@context" : "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
+ "collection" : {},
+ "query" : {
+ "@type":"koral:group",
+ "operation" : "operation:sequence",
+ "operands" : [
+ {
+ "@type" : "koral:token",
+ "wrap" : {
+ "@type" : "koral:termGroup",
+ "relation" : "relation:and",
+ "operands" : [ {
+ "@type" : "koral:term",
+ "foundry" : "tt",
+ "key" : "ADJA",
+ "layer" : "pos",
+ "match" : "match:eq"
+ },
+ {
+ "@type" : "koral:term",
+ "foundry" : "cnx",
+ "key" : "@PREMOD",
+ "layer" : "syn",
+ "match" : "match:eq"
+ } ]
+ }
+ },
+ {
+ "@type" : "koral:token",
+ "wrap" : {
+ "@type" : "koral:term",
+ "key" : "octopus",
+ "layer" : "lemma",
+ "match" : "match:eq"
+ }
+ } ]
+ }
+};
+
+
+queryExample = {
+ "@context" : "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
+ "collection" : {
+ "@type" : "koral:doc",
+ "key" : "pubDate",
+ "value" : "2005-05-25",
+ "type" : "type:date",
+ "match" : "match:geq"
+ },
+ "query" : {
+ "@type" : "koral:token",
+ "wrap" : {
+ "@type" : "koral:term",
+ "key" : "octopus",
+ "layer" : "lemma",
+ "match" : "match:eq"
+ }
+ }
+};
+
+queryExample = {
+ "@type":"koral:doc",
+ "key":"subTitle",
+ "value":"Gedichte",
+ "match":"match:eq",
+ "rewrites" : [
+ {
+ "@type": "koral:rewrite",
+ "src" : "policy",
+ "operation" : "operation:injection",
+ }
+ ]
+};
+
requirejs.config({
baseUrl: '../js/src',
@@ -424,6 +532,8 @@
}
});
+// KorAP.currentQuery = queryExample;
+
require(['init'], function (init) {
KorAP.hintArray = hintArray;
diff --git a/dev/demo/vc.html b/dev/demo/vc.html
index aa3822c..a3e27df 100644
--- a/dev/demo/vc.html
+++ b/dev/demo/vc.html
@@ -29,9 +29,11 @@
<div id="vc"></div>
<div id="menu" class="vc"></div>
+ <p><a onclick="KorAP.makeVCPersistant()" style="cursor:pointer">make persistant!</a></p>
+
<hr />
- <p><a onclick="KorAP.showJSON()" style="cursor:pointer">show JSON!</a></p>
+ <p><a onclick="KorAP.showJSON()" style="cursor:pointer">show KoralQuery!</a></p>
<div id="json" class="info"></div>
<hr />
diff --git a/dev/demo/vcdemo.js b/dev/demo/vcdemo.js
index d85f9fa..53ab75e 100644
--- a/dev/demo/vcdemo.js
+++ b/dev/demo/vcdemo.js
@@ -101,5 +101,10 @@
KorAP.showQuery = function () {
document.getElementById("query").innerHTML = vc.root().toQuery();
};
+
+ // make the current vc persistant
+ KorAP.makeVCPersistant = function () {
+ vc.makePersistant();
+ };
});
});