-
Notifications
You must be signed in to change notification settings - Fork 2
/
dimlex2conano.xsl
89 lines (75 loc) · 2.95 KB
/
dimlex2conano.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Document : stylesheet.xsl
Created on : 31. Mai 2004, 13:10
Author : Heintze / edited by Scheffler
Description:
Purpose of transformation follows.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml" encoding="utf-8" omit-xml-declaration="no" doctype-system="ConAnoLex.dtd" />
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:processing-instruction name="relations">
<xsl:text>relSet="Martin1992"</xsl:text>
</xsl:processing-instruction>
<xsl:text>
</xsl:text>
<xsl:element name="conanolex">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="entry">
<xsl:element name="entry">
<xsl:attribute name="id">
<xsl:number/>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="//ambiguity|//focuspart|//non_conn_reading"></xsl:template>
<xsl:template match="orth">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="syn">
<xsl:element name="syn">
<xsl:choose>
<xsl:when test="cat/text()='subj'">
<xsl:attribute name="type">subordinating</xsl:attribute>
</xsl:when>
<xsl:when test="cat/text()='postp'">
<xsl:attribute name="type">subordinating</xsl:attribute>
</xsl:when>
<xsl:when test="cat/text()='konj'">
<xsl:attribute name="type">coordinating</xsl:attribute>
</xsl:when>
<xsl:when test="cat/text()='praep'">
<xsl:attribute name="type">praepositional</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="type">adverbial</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:for-each select="sem">
<xsl:element name="sem">
<xsl:element name="coh-relation">
<xsl:value-of select="pdtb3_relation/@sense"/>
</xsl:element>
<xsl:for-each select="example">
<xsl:element name="example">
<xsl:value-of select="."/>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template>
<xsl:template match="dimlex|orths">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>