Browse Source

Merged restyling feature

Francesco 2 years ago
parent
commit
29317f1f61
2 changed files with 29 additions and 1 deletions
  1. 22 1
      js/nlp.js
  2. 7 0
      python/nlp.py

+ 22 - 1
js/nlp.js

@@ -66,10 +66,31 @@ crm:P128_carries ?object .\
 crm:P190_has_symbolic_content ?testo;\
 rdfs:label ?titolo .}"
 
+queryLocations = prefixes + "select ?b where {\
+    ?a <http://www.cidoc-crm.org/cidoc-crm/P2_has_type> 'Toponimo' .\
+    ?a <http://www.w3.org/2000/01/rdf-schema#label> ?b .\
+    }";
+console.log()
+
+
 async function fillPageContents(){
+//    val = await doJsonQuery(queryLocations);
+//    stringifyResponse(val);
     val = await doJsonQuery(queryTesto);
-    stringifyResponse(val); 
+    stringifyResponse(val);
     putValuesInHTML();
+
+    $.ajax({
+        url: '../python/nlp.py',
+        type: 'POST',
+        data: {places: ["prato", "firenze", "avignone", "siena"], text: queryStringOutput},
+        dataType: "json",
+        success: function(data){
+             alert(data);
+        }
+    });
+
+
 }
 
 function putValuesInHTML(){

+ 7 - 0
python/nlp.py

@@ -0,0 +1,7 @@
+import nltk, cgi
+nltk.download('punkt')
+from nltk import word_tokenize
+
+data = cgi.FieldStorage()
+
+print(data)