Attachment 'modify-tei-senses.pl'
Download 1 #!/usr/bin/perl
2
3
4 # Converts a "temporary TEI" morphosyntax (output of Anotatornia) to target TEI. Minor changes, mostly xi:include->corresp.
5
6 # Usage:
7 # perl modify-tei-senses <input file> <output file>
8 #
9
10 open INTEXT, "<$ARGV[0]";
11 open OUTTEXT, ">$ARGV[1]";
12
13
14 while (<INTEXT>) {
15
16 s#(<teiCorpus.*) xmlns:xlink.*>#$1>#;
17 s#(<teiCorpus.*) xmlns:nkjp=".*?"(.*)>#$1$2>#;
18 s/<s xlink:href=(".*?")/<s corresp=$1/;
19 s/<p xlink:href=(".*?")/<p corresp=$1/;
20 s/<seg xlink:href=(".*?")/<seg corresp=$1/;
21 s/<fs type="tool_report">/<fs feats="#an8003" type="tool_report">/;
22
23 unless (/^<\?o/) {
24 print OUTTEXT;
25 }
26
27 }
28
29 close INTEXT;
30 close OUTTEXT;
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.