Squiz Matrix
4.12.2
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
All
Data Structures
Namespaces
Functions
Variables
Pages
convert_fonz_for_import.php
1
<?php
26
if
($argc != 2) {
27
echo
"Usage: php convert_fonz_for_import inputfile.txt > outputfile.xml \n"
;
28
exit();
29
}
30
?>
31
<thesaurus>
32
<?php
33
$handle = fopen($argv[1],
'r'
);
34
while
((list($parent_term, $relation_name, $child_term) = fgetcsv($handle, 1000,
','
,
'"'
)) !== FALSE) {
35
// do not include definitions or scope notes because they are paragraphs
36
if
(($relation_name !=
'Definition'
) && ($relation_name !=
'Scope Note'
)) {
37
echo
'<term name="'
.$parent_term.
'">'
.
"\n"
;
38
echo
'<relation name="'
.$relation_name.
'">'
.
"\n"
;
39
echo
'<term name="'
.$child_term.
'"/>'
.
"\n"
;
40
echo
'</relation>'
.
"\n"
;
41
echo
'</term>'
.
"\n"
;
42
}
43
}
44
fclose($handle);
45
?>
46
</terms>
47
</thesaurus>
squiz_matrix
scripts
import
convert_fonz_for_import.php
Generated on Tue Jan 29 2013 14:05:06 for Squiz Matrix by
1.8.3.1