Commit c08edc5b authored by Decorde Jeffrey's avatar Decorde Jeffrey
Browse files

Merge branch 'master' of gitlab.utc.fr:crozatst/hdoc

parents da86dac8 355e15ff
# Converter lexique_to_opale
In order to use this converter, follow those steps :
1. Copy your Lexique file(s) (.scar or .zip) into the input directory.
2. Execute the run that correspond to your OS.
3. You will find the result into the output directory. The names of the output are linked to the hour it was processed.
...@@ -2,4 +2,6 @@ libdir=${basedir}/lib ...@@ -2,4 +2,6 @@ libdir=${basedir}/lib
rngdir=${basedir}/rng rngdir=${basedir}/rng
xsldir=${basedir}/xsl xsldir=${basedir}/xsl
srcdir=${basedir}/in srcdir=${basedir}/in
outdir=${basedir}/out outdir=${basedir}/out
\ No newline at end of file InputPath=${basedir}/input
OutputPath=${basedir}/output
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="clean" basedir=".">
<property file="build.properties"/>
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
<pathelement location="${libdir}/jing.jar"/>
</classpath>
</taskdef>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<target name="init">
<mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod>
<mkdir dir="${srcdir}"/>
<chmod perm="777" dir="${srcdir}"></chmod>
</target>
<target name="unzipSource" depends="init">
<for param="file">
<path>
<fileset dir="${InputPath}" id="inputsId">
<include name="*.zip"/>
<include name="*.scar"/>
</fileset>
</path>
<sequential>
<local name="TODAY_MY"/>
<tstamp>
<format property="TODAY_MY" pattern="yyyyMMdd-HHmmss" locale="en,UK" />
</tstamp>
<var name="name" unset="true"/>
<basename file="@{file}" property="name" />
<unzip src="${InputPath}/${name}" dest="${srcdir}/${TODAY_MY}"></unzip>
<sleep seconds="1"> </sleep>
</sequential>
</for>
</target>
<target name="buildOutput" depends="unzipSource">
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/termToRef.xsl" basedir="${srcdir}" destdir="${OutputPath}" followsymlinks="false" extension=".ref">
<include name="**/*.term"/>
</xslt>
<copy file="opale.wspmeta" tofile="${OutputPath}/.wspmeta"></copy>
<!--<jing rngfile="${rngdir}/op_glos.rng">
<fileset dir="${outdir}">
<include name="**/*.ref"/>
</fileset>
</jing>-->
</target>
<target name="clean" depends="buildOutput">
<delete dir="${srcdir}" />
<delete dir="${outdir}" />
</target>
</project>
\ No newline at end of file
@echo off
set lib=lib
set ant=lexique_to_opale.ant
set antparam=-Dprogram.param=%1
set scJarList=%lib%\*
java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
#!/bin/sh
lib="lib"
ant="lexique_to_opale.ant"
antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN
vJavaCmd="java"
xCheckJava () {
vInputVarName=\$"$1"
vInputVarVal=`eval "expr \"$vInputVarName\" "`
if [ -z "$vInputVarVal" ];then
eval "$1=false"
return
fi
vSunJavaFound=`$vInputVarVal -version 2>&1 | grep -Eo -m 1 "(HotSpot)|(OpenJDK)"`
if [ "$vSunJavaFound" != "HotSpot" ] && [ "$vSunJavaFound" != "OpenJDK" ] ; then
eval "$1=false"
return
fi
}
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
vJavaCmd="$JAVA_HOME/bin/java"
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
echo "ERREUR: JRE de SUN introuvable. Veuillez déclarer la variable d'environnement JAVA_HOME."
exit 1
fi
fi
#Lancer la commande
scJarList="$lib/*"
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
...@@ -96,6 +96,11 @@ ...@@ -96,6 +96,11 @@
<xsl:apply-templates select="node()|@*"/> <xsl:apply-templates select="node()|@*"/>
</xsl:copy> </xsl:copy>
</xsl:template> </xsl:template>
<xsl:template match="lx:defTxt/lx_defTxt_blocs/sc:para" >
<i>definition : </i>
<xsl:value-of select="."/>
</xsl:template>
<!-- <!--
FILTRAGE DES CONTENUS DE LA DEFINITION FILTRAGE DES CONTENUS DE LA DEFINITION
...@@ -192,4 +197,4 @@ ...@@ -192,4 +197,4 @@
<xsl:value-of select="document(@sc:refUri)/sc:item/lx:tag/lx:tagM/sp:title"></xsl:value-of> <xsl:value-of select="document(@sc:refUri)/sc:item/lx:tag/lx:tagM/sp:title"></xsl:value-of>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>
\ No newline at end of file
# Converter lexique_to_optim
In order to use this converter, follow those steps :
1. Copy your Lexique file(s) (.scar or .zip) into the input directory.
2. Execute the run that correspond to your OS.
3. You will find the result into the output directory. The name of the output files depends of the hour it was processed.
...@@ -2,4 +2,6 @@ libdir=${basedir}/lib ...@@ -2,4 +2,6 @@ libdir=${basedir}/lib
rngdir=${basedir}/rng rngdir=${basedir}/rng
xsldir=${basedir}/xsl xsldir=${basedir}/xsl
srcdir=${basedir}/in srcdir=${basedir}/in
outdir=${basedir}/out outdir=${basedir}/out
\ No newline at end of file InputPath=${basedir}/input
OutputPath=${basedir}/output
\ No newline at end of file
...@@ -3,16 +3,19 @@ ...@@ -3,16 +3,19 @@
<property file="build.properties"/> <property file="build.properties"/>
<property name="InputPath" value="" />
<property name="OutputPath" value="" />
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"> <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath> <classpath>
<pathelement location="${libdir}/jing.jar"/> <pathelement location="${libdir}/jing.jar"/>
</classpath> </classpath>
</taskdef> </taskdef>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="lib/ant-contrib.jar"/>
</classpath>
</taskdef>
<target name="init"> <target name="init">
<mkdir dir="${outdir}"/> <mkdir dir="${outdir}"/>
<chmod perm="777" dir="${outdir}"></chmod> <chmod perm="777" dir="${outdir}"></chmod>
...@@ -21,18 +24,33 @@ ...@@ -21,18 +24,33 @@
</target> </target>
<target name="unzipSource" depends="init"> <target name="unzipSource" depends="init">
<echo>Fichier en entree : ${InputPath}</echo> <for param="file">
<echo>Fichier de sortie : ${OutputPath}</echo> <path>
<fileset dir="${InputPath}" id="inputsId">
<unzip src="${InputPath}" dest="${srcdir}"></unzip> <include name="*.zip"/>
<include name="*.scar"/>
</fileset>
</path>
<sequential>
<local name="TODAY_MY"/>
<tstamp>
<format property="TODAY_MY" pattern="yyyyMMdd-HHmmss" locale="en,UK" />
</tstamp>
<var name="name" unset="true"/>
<basename file="@{file}" property="name" />
<unzip src="${InputPath}/${name}" dest="${srcdir}/${TODAY_MY}"></unzip>
<sleep seconds="1"> </sleep>
</sequential>
</for>
</target> </target>
<target name="buildOutput" depends="unzipSource"> <target name="buildOutput" depends="unzipSource">
<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/termToRefs.xsl" basedir="${srcdir}" destdir="${outdir}" followsymlinks="false" extension=".refs"> <xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/termToRefs.xsl" basedir="${srcdir}" destdir="${OutputPath}" followsymlinks="false" extension=".refs">
<include name="**/*.term"/> <include name="**/*.term"/>
<param name="srcdir" expression="${srcdir}"/> <param name="srcdir" expression="${srcdir}"/>
<param name="outdir" expression="${outdir}"/> <param name="outdir" expression="${outdir}"/>
</xslt> </xslt>
<!--<jing rngfile="${rngdir}/of_def.rng"> <!--<jing rngfile="${rngdir}/of_def.rng">
<fileset dir="${outdir}"> <fileset dir="${outdir}">
<include name="**/*.refs"/> <include name="**/*.refs"/>
...@@ -41,7 +59,7 @@ ...@@ -41,7 +59,7 @@
</target> </target>
<target name="imageCopy" depends="unzipSource"> <target name="imageCopy" depends="unzipSource">
<copy todir="${outdir}"> <copy todir="${OutputPath}">
<fileset dir="${srcdir}"> <fileset dir="${srcdir}">
<include name="**/*.jpg"/> <include name="**/*.jpg"/>
<include name="**/*.png"/> <include name="**/*.png"/>
...@@ -50,12 +68,7 @@ ...@@ -50,12 +68,7 @@
</copy> </copy>
</target> </target>
<target name="exportOutput" depends="buildOutput,imageCopy"> <target name="clean" depends="buildOutput,imageCopy">
<copy file="optim.wspmeta" tofile="${outdir}/.wspmeta"></copy>
<zip basedir="${outdir}" destfile="${OutputPath}" encoding="UTF-8"></zip>
</target>
<target name="clean" depends="exportOutput">
<delete dir="${srcdir}" /> <delete dir="${srcdir}" />
<delete dir="${outdir}" /> <delete dir="${outdir}" />
</target> </target>
......
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