Mercurial > hg > audio-features-catalogue
comparison 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 |
comparison
equal
deleted
inserted
replaced
3:b08d29ebb928 | 4:8bd8453e0551 |
---|---|
4 | 4 |
5 names = [line.strip() for line in open('pdfextract/names.txt')] | 5 names = [line.strip() for line in open('pdfextract/names.txt')] |
6 cat = [line.strip() for line in open('pdfextract/categories.txt')] | 6 cat = [line.strip() for line in open('pdfextract/categories.txt')] |
7 sig = [line.strip() for line in open('pdfextract/sig.txt')] | 7 sig = [line.strip() for line in open('pdfextract/sig.txt')] |
8 | 8 |
9 local = 'http://sovarr.c4dm.eecs.qmul.ac.uk/features/' | |
10 | |
11 graph = Graph() | 9 graph = Graph() |
12 graph.bind('local', URIRef(local)) | 10 |
13 graph.bind('dc', URIRef('http://purl.org/dc/elements/1.1/')) | 11 af = Namespace('http://sovarr.c4dm.eecs.qmul.ac.uk/features/') |
14 graph.bind('owl', URIRef('http://www.w3.org/2002/07/owl#')) | 12 graph.bind('af', af) |
13 | |
14 dc = Namespace('http://purl.org/dc/elements/1.1/') | |
15 graph.bind('dc', dc) | |
16 | |
17 owl = Namespace('http://www.w3.org/2002/07/owl#') | |
18 graph.bind('owl', owl) | |
15 | 19 |
16 i = 0 | 20 i = 0 |
17 | 21 |
18 order = [ | 22 order = [ |
19 "Zero Crossing Rate", | 23 "Zero Crossing Rate", |
99 URIRef(id), | 103 URIRef(id), |
100 URIRef(local + 'temporalscale'), | 104 URIRef(local + 'temporalscale'), |
101 Literal(temp) | 105 Literal(temp) |
102 )) | 106 )) |
103 | 107 |
104 | |
105 if word[1] == 'Y': | 108 if word[1] == 'Y': |
106 temp = 'perceptual' | 109 temp = 'perceptual' |
107 else: | 110 else: |
108 temp = 'physical' | 111 temp = 'physical' |
109 | 112 |
132 Literal(temp) | 135 Literal(temp) |
133 )) | 136 )) |
134 | 137 |
135 if word[4] == 'V': | 138 if word[4] == 'V': |
136 temp = 'parameterized' | 139 temp = 'parameterized' |
140 dim = 'multi-dimensional' | |
137 else: | 141 else: |
138 temp = word[4] | 142 temp = word[4] |
143 if int(temp) == 1: | |
144 dim = 'one-dimensional' | |
145 else: | |
146 dim = 'multi-dimensional' | |
139 | 147 |
140 graph.add(( | 148 graph.add(( |
141 URIRef(id), | 149 URIRef(id), |
142 URIRef(local + 'dimensions'), | 150 URIRef(local + 'dimensions'), |
143 Literal(temp) | 151 Literal(temp) |
152 )) | |
153 | |
154 graph.add(( | |
155 URIRef(id), | |
156 URIRef(local + 'dimensionality'), | |
157 Literal(dim) | |
144 )) | 158 )) |
145 | 159 |
146 temp = { | 160 temp = { |
147 'ASR': "speech recognition", | 161 'ASR': "speech recognition", |
148 'ESR': "environmental sound recognition", | 162 'ESR': "environmental sound recognition", |