Commit 7ee56f32 authored by POGODALLA Sylvain's avatar POGODALLA Sylvain
Browse files

1.1 version of the French FraCas test suite

parent 5efec1b4
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<!-- document outline -->
<xsl:template match="/">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>FraCas Project</title>
<style>
body {
font-family: Lucida Sans, Arial, Helvetica, sans-serif;
font-size: 12px;
}
td {
font-family: Lucida Sans, Arial, Helvetica, sans-serif;
font-size: 12px;
}
td.prob-id {
width: 100px;
}
td.prob-language {
width: 100px;
}
td.prob-fracas-ans {
width: 150px;
}
div.comment {
background: #cccccc;
padding: 10px;
margin-top: 10px;
margin-bottom: 10px;
}
h1 {
background: #ffffcc;
padding: 10px;
margin-top: 10px;
margin-bottom: 10px;
}
h2 {
background: #ffffcc;
padding: 10px;
margin-top: 10px;
margin-bottom: 10px;
}
h3 {
background: #ffffcc;
padding: 10px;
margin-top: 10px;
margin-bottom: 10px;
}
div.problem {
background: #C8DBFF;
padding: 10px;
margin-top: 10px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<!-- comment -->
<xsl:template match="comment[@class='intro']">
<div class="comment">
<pre> <xsl:value-of select="text()"/> </pre>
</div>
</xsl:template>
<xsl:template match="comment[@class='section']">
<h1>
<xsl:value-of select="text()"/>
</h1>
</xsl:template>
<xsl:template match="comment[@class='subsection']">
<h2>
<xsl:value-of select="text()"/>
</h2>
</xsl:template>
<xsl:template match="comment[@class='subsubsection']">
<h3>
<xsl:value-of select="text()"/>
</h3>
</xsl:template>
<xsl:template match="comment">
<div class="comment" id="{@id}">
<pre> <xsl:value-of select="text()"/> </pre>
</div>
</xsl:template>
<!-- problem -->
<xsl:template match="problem">
<div class="problem">
<table>
<tr>
<!-- id -->
<td class="prob-id">
fracas-<xsl:value-of select="@id"/>
</td>
<td class="prob-language">
lang: <xsl:value-of select="@language"/>
</td>
<!-- fracas_answer -->
<xsl:if test="@fracas_answer">
<td class="prob-fracas-ans">
answer:
<xsl:choose>
<xsl:when test="@fracas_answer='yes'">
<font color="green">
<xsl:value-of select="@fracas_answer"/>
</font>
</xsl:when>
<xsl:when test="@fracas_answer='no'">
<font color="red">
<xsl:value-of select="@fracas_answer"/>
</font>
</xsl:when>
<xsl:when test="@fracas_answer='undef'">
<font color="fuchsia">
<xsl:value-of select="@fracas_answer"/>
</font>
</xsl:when>
<xsl:otherwise>
<font color="black">
<xsl:value-of select="@fracas_answer"/>
</font>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="@fracas_nonstandard='true'">
**
</xsl:if>
</td>
</xsl:if>
</tr>
</table>
<table width="100%">
<xsl:apply-templates select="p"/>
<xsl:apply-templates select="q"/>
<xsl:apply-templates select="h"/>
<xsl:apply-templates select="a"/>
<xsl:apply-templates select="why"/>
<xsl:apply-templates select="note"/>
</table>
</div>
</xsl:template>
<!-- premise -->
<xsl:template match="p|q|h|a">
<tr>
<td width="60" valign="top" >
<xsl:choose>
<xsl:when test="name() = 'p'">P<xsl:value-of select="@idx"/></xsl:when>
<xsl:when test="name() = 'q'">Q</xsl:when>
<xsl:when test="name() = 'h'">H</xsl:when>
<xsl:when test="name() = 'a'">A</xsl:when>
</xsl:choose>
</td>
</tr>
<tr>
<td valign="top"> script </td>
<td colspan="2">
<xsl:value-of select="script"/>
</td>
</tr>
<tr>
<td valign="top"> translit </td>
<td colspan="2">
<xsl:value-of select="translit"/>
</td>
</tr>
<xsl:if test="name() != 'a'">
<tr>
<td valign="top"> morph </td>
<td colspan="2">
<xsl:value-of select="morph"/>
</td>
</tr>
</xsl:if>
<tr>
<td valign="top"> English </td>
<td colspan="2">
<xsl:value-of select="english"/>
</td>
</tr>
</xsl:template>
<!-- why -->
<xsl:template match="why">
<tr>
<td valign="top"> Why </td>
<td colspan="2">
<i> <xsl:copy-of select="text()|node()" /> </i>
</td>
</tr>
</xsl:template>
<!-- note -->
<xsl:template match="note">
<tr>
<td valign="top"> Note </td>
<td colspan="2">
<i> <xsl:copy-of select="text()|node()" /> </i>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT fracas-problems (copyright?,versions?,(comment|problem)+)>
<!-- version information -->
<!ELEMENT copyright (#PCDATA)>
<!-- Used to annotate various elements. For instance, 'note' elements -->
<!ELEMENT versions (version+)>
<!ELEMENT version (date,number,authors?)>
<!ATTLIST version
id ID #REQUIRED>
<!ELEMENT number (#PCDATA)>
<!ELEMENT date (year,month,day)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT month (#PCDATA)>
<!ELEMENT day (#PCDATA)>
<!ELEMENT authors (author+)>
<!ELEMENT author (#PCDATA)>
<!-- miscellaneous comment, not necessarily on a specific problem -->
<!ELEMENT comment (#PCDATA)>
<!ATTLIST comment
class (intro|section|subsection|subsubsection) #IMPLIED>
<!ELEMENT problem (p+,q?,h?,a?,why?,note*)>
<!-- fracas_answer is one of four canonical answers for Fracas problems -->
<!ATTLIST problem
id CDATA #REQUIRED
fracas_answer (yes|no|unknown|undef) #IMPLIED
fracas_nonstandard (true) #IMPLIED
language (fa|de|zh|fr) #IMPLIED>
<!-- premise elements, possibly more than one -->
<!ELEMENT p (script,morph?,english)>
<!ATTLIST p
idx (1|2|3|4|5) #REQUIRED>
<!-- question element, optional -->
<!ELEMENT q (script,morph?,english)>
<!-- hypothesis element -->
<!ELEMENT h (script,morph?,english)>
<!-- original answer for FraCaS problem (sometimes non-standard) -->
<!ELEMENT a (script?,english,note?)>
<!-- justification for FraCaS answer -->
<!ELEMENT why (#PCDATA)>
<!-- miscellaneous note or comment about problem -->
<!ELEMENT note (#PCDATA)>
<!ATTLIST note
version IDREF #IMPLIED>
<!-- translation in the target language script -->
<!ELEMENT script (#PCDATA)>
<!-- transliteration of the target language translation -->
<!ELEMENT translit (#PCDATA)>
<!-- morphological representation of the target language -->
<!ELEMENT morph (#PCDATA)>
<!-- original English sentence -->
<!ELEMENT english (#PCDATA)>
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment