diff pdfextract/writeBase.py @ 4:8bd8453e0551

added fuxi facts and rules
author nothing@tehis.net
date Tue, 02 Apr 2013 15:33:18 +0100
parents 365a37a2fb6c
children
line wrap: on
line diff
--- a/pdfextract/writeBase.py	Mon Apr 01 21:26:45 2013 +0100
+++ b/pdfextract/writeBase.py	Tue Apr 02 15:33:18 2013 +0100
@@ -6,12 +6,16 @@
 cat = [line.strip() for line in open('pdfextract/categories.txt')]
 sig = [line.strip() for line in open('pdfextract/sig.txt')]
 
-local = 'http://sovarr.c4dm.eecs.qmul.ac.uk/features/'
+graph = Graph()
 
-graph = Graph()
-graph.bind('local', URIRef(local))
-graph.bind('dc', URIRef('http://purl.org/dc/elements/1.1/'))
-graph.bind('owl', URIRef('http://www.w3.org/2002/07/owl#'))
+af = Namespace('http://sovarr.c4dm.eecs.qmul.ac.uk/features/')
+graph.bind('af', af)
+
+dc = Namespace('http://purl.org/dc/elements/1.1/')
+graph.bind('dc', dc)
+
+owl = Namespace('http://www.w3.org/2002/07/owl#')
+graph.bind('owl', owl)
 
 i = 0
 
@@ -101,7 +105,6 @@
         Literal(temp) 
     ))
     
-    
     if word[1] == 'Y': 
         temp = 'perceptual'
     else:
@@ -134,14 +137,25 @@
     
     if word[4] == 'V':
         temp = 'parameterized'
+        dim = 'multi-dimensional'
     else:
         temp = word[4]
+        if int(temp) == 1:
+            dim = 'one-dimensional'
+        else:
+            dim = 'multi-dimensional'
         
     graph.add(( 
         URIRef(id),
         URIRef(local + 'dimensions'), 
         Literal(temp) 
     ))
+
+    graph.add(( 
+        URIRef(id),
+        URIRef(local + 'dimensionality'), 
+        Literal(dim) 
+    ))
     
     temp = {
         'ASR': "speech recognition",