<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://www.fabienpoulard.info/dotclear.php?feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Blog d'un jeune chercheur en TAL</title>
  <link>http://www.fabienpoulard.info/dotclear.php?</link>
  <atom:link href="http://www.fabienpoulard.info/?feed/rss2" rel="self" type="application/rss+xml"/>
  <description></description>
  <language>fr</language>
  <pubDate>Sat, 04 Sep 2010 00:36:03 +0200</pubDate>
  <copyright>Tous les contenus sont publiés sous licence CC-by-sa, sauf mentions contraires.</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Benoît XVI m'énerve profondément</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/09/04/Beno%C3%AEt-XVI-m-%C3%A9nerve-profond%C3%A9ment</link>
    <guid isPermaLink="false">urn:md5:3546757c9ae137edbfaa85b5847ccdcf</guid>
    <pubDate>Sat, 04 Sep 2010 02:11:00 +0200</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Citoyen &amp; Politique</category>
        <category>religion</category>    
    <description>&lt;p&gt;Je n'aime pas la religion, il s'agit à mon avis du pire système d'aliénation mis en place depuis l'existence de l'homme. Mon ressentiment est indifférent&amp;nbsp;: je déteste les trois monothéismes principaux (qui reposent de toute façon sur le même Livre) avec la même vigueur, et par extension toute forme de gouvernance qui élève un être supérieur infaillible et qui décide de la morale et de la loi sans consulter le peuple. Je pense que l'&lt;a href=&quot;http://fr.wikipedia.org/wiki/Apath%C3%A9isme&quot; hreflang=&quot;fr&quot;&gt;apathéisme&lt;/a&gt; correspond le mieux à ma condition.&lt;/p&gt;


&lt;p&gt;Vous voilà prévenus, ce n'est pas la peine de lire la suite si vous pensez qu'elle va vous blesser. Je respecte que chacun, en privé, pratique sa religion du moment qu'il ne cherche pas à propager ses croyances au reste de la société. Nul besoin de vous laisser offenser si vous êtes un fervent croyant, ce n'est pas mon but.&lt;/p&gt;    &lt;p&gt;L'omniprésence de la religion musulmane telle que présentée par les médias (mais qui à mon avis n'est pas aussi marquée que cela) associée à l'érosion continue du christianisme en Europe déplaît à la paposphère. On savait Benoît XVI bien plus radical que ne l'était Jean-Paul II, il l'a démontré une fois de plus dans &lt;a href=&quot;http://press.catholica.va/news_services/bulletin/news/25965.php?index=25965&amp;amp;lang=fr#TRADUZIONE%20IN%20LINGUA%20FRANCESE&quot; hreflang=&quot;fr&quot;&gt;un message en amont de la 26e Journée Mondiale de la Jeunesse&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;La quintessence du message transmis se résume en cette phrase&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;&lt;em&gt;il y a un fort courant «&amp;nbsp;laïciste », qui veut supprimer Dieu de la vie des personnes et de la société, projetant et tentant de créer un «paradis» sans Lui. Or l’expérience enseigne qu’un monde sans Dieu est un «enfer» où prévalent les égoïsmes, les divisions dans les familles, la haine entre les personnes et les peuples, le manque d’amour, de joie et d’espérance.&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;Selon Benoît XVI il faut craindre le laïcisme qui cherche à &quot;supprimer Dieu de la vie des personnes et de la société&quot;. Contrairement au christianisme qui appelle à répandre la bonne nouvelle (une forme de diffusion où l'on ne peut évidemment pas se permettre de jeter les pélerins dans une corbeille à spam), le laïcisme cherche uniquement à retirer Dieu de la société afin que chacun puisse choisir son Dieu et vivre sa religion en privé. La &lt;a href=&quot;http://fr.wikipedia.org/wiki/La%C3%AFcisme&quot; hreflang=&quot;fr&quot;&gt;définition de wikipédia&lt;/a&gt; est très claire sur ce point&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;&lt;em&gt;Le laïcisme est un courant d'idées qui vise à protéger activement la vie publique de toute ingérence religieuse. Si la laïcité applique avec une certaine souplesse la séparation de l'État et des Églises, le laïcisme souhaite réduire la vie religieuse des citoyens à la seule sphère privée, hors de toute manifestation sociale et publique.&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;Benoît XVI fait usage ici de &lt;a href=&quot;http://fr.wikipedia.org/wiki/Paralogisme&quot;&gt;paralogisme&lt;/a&gt; et d'&lt;a href=&quot;http://www.arretsurimages.net/contenu.php?id=3305&quot; hreflang=&quot;fr&quot;&gt;amalgame&lt;/a&gt; à des fins de manipulation. Ces discours manipulateurs sont malheureusement assez courants de nos jours.&lt;/p&gt;


&lt;p&gt;La phrase qui m'a fait bondir et qui est à l'origine de ce billet (qui traîne en longueur) est celle-ci&amp;nbsp;: &quot;toutes les valeurs qui fondent la société proviennent de l'Évangile, comme le sens de la dignité de la personne, de la solidarité, du travail et de la famille&quot;. Mais bien sûr... Je me permets donc un petit rappel de catéchèse en piochant aléatoirement (enfin, pas vraiment, moi aussi j'ai envie de jouer un peu au manipulateur)&amp;nbsp;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;à propos de la dignité de la personne, je citerais les versets &lt;ins&gt;1R.21.28-29&lt;/ins&gt;&amp;nbsp;: &lt;em&gt;Alors la parole de Yahvé fut adressée à Élie le Tishbite en ces termes&amp;nbsp;: &quot; As-tu vu comme Achab s'est humilié devant moi&amp;nbsp;? Parce qu'il s'est humilié devant moi, je ne ferai pas venir le malheur pendant son temps&amp;nbsp;; c'est au temps de son fils que je ferai venir le malheur sur sa maison. &quot;&lt;/em&gt;. Je ne suis pas sûr que la nécessité de s'humilier pour éviter un châtiment soit la meilleure leçon de dignité humaine. Je préfère l'&lt;a href=&quot;http://www.un.org/fr/documents/udhr/#a1&quot; hreflang=&quot;fr&quot;&gt;article premier&lt;/a&gt; de la déclaration des droits de l'homme&amp;nbsp;: &lt;strong&gt;Christianisme&amp;nbsp;: 0 - République des Lumières&amp;nbsp;: 1&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;à propos de la solidarité, je citerais les versets &lt;ins&gt;Gn.7.1&lt;/ins&gt;&amp;nbsp;: &lt;em&gt;Le Seigneur dit à Noé&amp;nbsp;: «&amp;nbsp;Entre dans l'arche, toi et ta famille, car j'ai constaté que tu es le seul parmi tes contemporains à m'être fidèle.&lt;/em&gt;. Je traduis&amp;nbsp;: laisse tomber tes semblables et sauve ta peau. Là encore j'ai une préférence pour notre système de sécurité sociale (mutualisation des coûts de santé, retraites, ...)&amp;nbsp;: &lt;strong&gt;Christianisme&amp;nbsp;: 0 - République des Lumières&amp;nbsp;: 2&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;à propos de la famille, je reprendrais les fameux versets concernant le sacrifice d'Isaac &lt;ins&gt;Gn.22.2&lt;/ins&gt;&amp;nbsp;: &lt;em&gt;Dieu reprit&amp;nbsp;: «&amp;nbsp;Prends ton fils Isaac, ton fils unique que tu aimes tant, va dans le pays de Moria, sur une montagne que je t'indiquerai, et là offre-le-moi en sacrifice. »&lt;/em&gt;. N'hésite pas à égorger ton fils unique comme un agneau pour l'amour de ton Dieu, score sans appel&amp;nbsp;:  &lt;strong&gt;Christianisme&amp;nbsp;: 0 - République des Lumières&amp;nbsp;: 3&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;puisque je suis sympa j'accorde une égalité sur le thème du travail avec le verset &lt;ins&gt;Sir.34.27&lt;/ins&gt;&amp;nbsp;: &lt;em&gt;C'est commettre un assassinat que de priver un ouvrier de son salaire.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Score final&amp;nbsp;: &lt;strong&gt;Christianisme&amp;nbsp;: 1 - République des Lumières&amp;nbsp;: 4&lt;/strong&gt;&amp;nbsp;; victoire par KO de notre République. Ses valeurs sont majoritairement issues des réflexions philosophiques de Platon qui a vécu plus de 300 ans avant J.C., c-à-d bien avant l'évangélisation massive de l'Europe. Avant cette évangélisation (ces fameuses racines chrétiennes) la &lt;em&gt;pax romana&lt;/em&gt; nous offrait les aqueducs, une infrastructure routière, l'hygiène (bains et latrines), des ingénieurs civils,... Suite à l'évangélisation nous avons eu droit à 1400 ans d'obscurantisme, de condamnation de la science et du progrès. Il faudra attendre les humanistes qui ont remis l'homme au centre du monde en piochant dans les préceptes antiques grecs. Le laïcisme est né de ce besoin de replacer l'homme au centre du monde, et c'est une bonne chose&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;En guise de conclusion, je me permets de placer le verset &lt;ins&gt;Ma.3.5&lt;/ins&gt;&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;&lt;em&gt;le Seigneur de l'univers déclare&amp;nbsp;: «Je viendrai au milieu de vous pour vous juger. Je m'empresserai d'accuser ceux qui pratiquent la magie, qui commettent l'adultère, qui prononcent de faux serments, qui retiennent le salaire des ouvriers, qui oppriment les veuves et les orphelins ou qui font du tort aux étrangers, tous ceux qui ne tiennent aucun compte de moi.» »&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;Notez que toutes ces fautes sont placées au même niveau. Rien sur l’assassinat... qui est tout de même l'atteinte la plus grave qui puisse être faite à un être humain... sans doute les meurtriers sont à classer dans &lt;em&gt;ceux qui ne tiennent aucun compte de moi&lt;/em&gt;.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/09/04/Beno%C3%AEt-XVI-m-%C3%A9nerve-profond%C3%A9ment#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/09/04/Beno%C3%AEt-XVI-m-%C3%A9nerve-profond%C3%A9ment#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/95</wfw:commentRss>
      </item>
    
  <item>
    <title>Calculer le recouvrement de deux textes avec NLTK</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/08/26/Calculer-le-recouvrement-de-deux-textes-avec-NLTK</link>
    <guid isPermaLink="false">urn:md5:ffd1147a86e1447188b7127ab7d182a6</guid>
    <pubDate>Thu, 26 Aug 2010 19:00:00 +0200</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Sciences &amp; Recherche</category>
        <category>nlp</category><category>nltk</category><category>python</category>    
    <description>&lt;p&gt;Mon travail de thèse, sobrement intitulée &lt;em&gt;Approches par calcul de similarité inter-documentaire pour la détection de dérivations de texte&lt;/em&gt;, consiste à évaluer la probabilité qu'un texte dérive d'un autre. Une des applications, que je déteste mais qui a l'avantage de parler à la plupart des gens, est la détection de plagiat.&lt;/p&gt;


&lt;p&gt;Une approche, naïve mais simple à mettre en œuvre, consiste à calculer le nombre de mots que deux textes partagent. Voici une proposition d'implémentation d'une telle technique tirant partie de la &lt;a href=&quot;http://www.nltk.org/&quot; hreflang=&quot;en&quot;&gt;bibliothèque NLTK&lt;/a&gt;.&lt;/p&gt;    &lt;p&gt;Le calcul de la couverture en terme de mots de deux textes n'a rien de bien compliqué dans la mesure où&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;il nous est possible de découper le texte en mots&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;nous savons compter le nombre de mots qu'ils ont en commun.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pour le découpage en mots, nous allons utiliser la &lt;a href=&quot;http://www.nltk.org/&quot; hreflang=&quot;en&quot;&gt;bibliothèque NLTK&lt;/a&gt; (j'utilise la version bêta de la 2.0) qui propose une méthode &lt;em&gt;word_tokenize&lt;/em&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;python python&quot; style=&quot;font-family:inherit&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; nltk&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;nltk.&lt;span style=&quot;color: black;&quot;&gt;word_tokenize&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;u&lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;A sentence to be tokenized&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;u&lt;span style=&quot;color: #483d8b;&quot;&gt;'A'&lt;/span&gt;, u&lt;span style=&quot;color: #483d8b;&quot;&gt;'sentence'&lt;/span&gt;, u&lt;span style=&quot;color: #483d8b;&quot;&gt;'to'&lt;/span&gt;, u&lt;span style=&quot;color: #483d8b;&quot;&gt;'be'&lt;/span&gt;, u&lt;span style=&quot;color: #483d8b;&quot;&gt;'tokenized'&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Le tokeniseur est loin d'être parfait, notamment pour les textes qui ne sont pas de l'anglais, mais il fonctionne suffisamment bien pour l'utilisation que nous en avons. Ce serait beaucoup plus problématique pour une tâche de recherche d'information par exemple.&lt;/p&gt;


&lt;p&gt;Nous passerons donc le contenu des fichiers à comparer à cette fonction qui nous retourne la liste des mots correspondant. Il nous faut alors calculer l'intersection des deux listes de mots.&lt;/p&gt;


&lt;p&gt;Les objets &lt;em&gt;set&lt;/em&gt; offrent une méthode &lt;em&gt;intersection&lt;/em&gt; qui ferait l'affaire. Cependant la conversion en un ensemble va faire disparaître les doublons, or nous aimerions avoir un recouvrement aussi précis que possible. Nous définissons donc une fonction qui va calculer l'intersection de deux listes. Elle peut certainement être largement améliorée (ne pas hésiter à proposer une correction), mais suffira pour l'exemple&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;python python&quot; style=&quot;font-family:inherit&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; intersect_list&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;lst1, lst2&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;	Calcule l'intersection entre deux listes&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;	&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Intersection&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	inter = &lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Calcul des éléments en commun&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	common = &lt;span style=&quot;color: #008000;&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;lst1&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;intersection&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;lst2&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Construction de la liste commune&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; e &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; common:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;		nbe = &lt;span style=&quot;color: #008000;&quot;&gt;min&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;lst1.&lt;span style=&quot;color: black;&quot;&gt;count&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;, lst2.&lt;span style=&quot;color: black;&quot;&gt;count&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;		&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;range&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;nbe&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;			inter.&lt;span style=&quot;color: black;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;return&lt;/span&gt; inter&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Nous avons désormais en main tous les éléments nécessaire pour écrire un petit script qui calculera le taux de recouvrement en mots entre deux fichiers textes.&lt;/p&gt;


&lt;p&gt;Voici le script complet pour ceux que ça intéresse&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;python python&quot; style=&quot;font-family:inherit&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#! /usr/bin/python&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# -*- coding: utf-8 -*-&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Script permettant de calculer le taux de recouvrement en mots entre les&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# deux textes passés en paramètre.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; nltk&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #dc143c;&quot;&gt;os&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;path&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #dc143c;&quot;&gt;codecs&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; loadTxt&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;fic&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;	Charge le contenu textuel du fichier en paramètre&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;	&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	fh  = &lt;span style=&quot;color: #dc143c;&quot;&gt;codecs&lt;/span&gt;.&lt;span style=&quot;color: #008000;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;fic, &lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;r&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;, errors=&lt;span style=&quot;color: #483d8b;&quot;&gt;'ignore'&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	txt = fh.&lt;span style=&quot;color: black;&quot;&gt;read&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	fh.&lt;span style=&quot;color: black;&quot;&gt;close&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;return&lt;/span&gt; txt&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; intersect_list&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;lst1, lst2&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;	Calcule l'intersection entre deux listes&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;	&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Intersection&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	inter = &lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Calcul des éléments en commun&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	common = &lt;span style=&quot;color: #008000;&quot;&gt;set&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;lst1&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;intersection&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;lst2&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Construction de la liste commune&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; e &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; common:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;		nbe = &lt;span style=&quot;color: #008000;&quot;&gt;min&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;lst1.&lt;span style=&quot;color: black;&quot;&gt;count&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;, lst2.&lt;span style=&quot;color: black;&quot;&gt;count&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;		&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;range&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;nbe&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;			inter.&lt;span style=&quot;color: black;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;return&lt;/span&gt; inter&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Vérifie qu'il y a bien deux fichiers passés en paramètre du script&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; == &lt;span style=&quot;color: #ff4500;&quot;&gt;3&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Charge les textes des fichiers&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	txt1 = loadTxt&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	txt2 = loadTxt&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Tokenisation en mots&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	txt1toks = nltk.&lt;span style=&quot;color: black;&quot;&gt;word_tokenize&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;txt1&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	txt2toks = nltk.&lt;span style=&quot;color: black;&quot;&gt;word_tokenize&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;txt2&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Calcul de la couverture&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	incommon = intersect_list&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;txt1toks, txt2toks&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Affichage&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;Couverture de %s par rapport à %s&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;,&lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\t&lt;/span&gt;%f&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;incommon&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;/&lt;span style=&quot;color: #008000;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;txt1toks&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;Couverture de %s par rapport à %s&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;,&lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\t&lt;/span&gt;%f&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;incommon&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;/&lt;span style=&quot;color: #008000;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;txt2toks&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;Utilisation :&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;	&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\t&lt;/span&gt;%s &amp;lt;fichier 1&amp;gt; &amp;lt;fichier 2&amp;gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;%&lt;/span&gt; &lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Bien entendu, le taux de recouvrement en mots n'est pas très performant pour évaluer le degré de dérivation entre deux textes. Une manière de l'améliorer serait de calculer le taux de recouvrement de n-grammes plutôt. J'attends vos propositions :)&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/08/26/Calculer-le-recouvrement-de-deux-textes-avec-NLTK#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/08/26/Calculer-le-recouvrement-de-deux-textes-avec-NLTK#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/94</wfw:commentRss>
      </item>
    
  <item>
    <title>Migration...</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/08/25/Migration...</link>
    <guid isPermaLink="false">urn:md5:e03507c487375a8599d8cdcbb22717c0</guid>
    <pubDate>Wed, 25 Aug 2010 04:06:00 +0200</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
            
    <description>    &lt;p&gt;Je profite des &quot;vacances&quot; (cette période assez floue où je rédige ma thèse et où le reste du monde est en vacances) pour m'occuper de la migration de mon serveur. Je passe de l'offre originale Dédibox à la nouvelle offre premier prix d'Online (nouveau nom de Dédibox).&lt;/p&gt;


&lt;p&gt;Il y aura certainement des petits soucis d'ici la fin de la migration...&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/08/25/Migration...#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/08/25/Migration...#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/93</wfw:commentRss>
      </item>
    
  <item>
    <title>Du bon usage des ressources dans UIMA</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/07/16/Du-bon-usage-des-ressources-dans-UIMA</link>
    <guid isPermaLink="false">urn:md5:05c197e84d054d473c2e1eeba9e83370</guid>
    <pubDate>Sat, 17 Jul 2010 01:46:00 +0200</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Geek &amp; Technique</category>
        <category>uima</category>    
    <description>&lt;p&gt;Les &lt;a href=&quot;http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/html/references/references.html#ugr.ref.xml.component_descriptor.aes.aggregate.external_resource_bindings&quot;&gt;ressources&lt;/a&gt; sont un aspect de UIMA que j'ai peu abordé et que j'ai très peu utilisé, sauf récemment lorsque l'on a entraîné un modèle français HMM pour le &lt;a href=&quot;http://uima.apache.org/sandbox.html#tagger.annotator&quot;&gt;HMM Tagger&lt;/a&gt; (il faut que j'écrive un billet à ce sujet d'ailleurs). Pourtant les ressources, et leur rôle, sont assez mal compris au sein d'UIMA.&lt;/p&gt;    &lt;h2&gt;L'erreur de Jérôme&lt;/h2&gt;


&lt;p&gt;Je m'excuse par avance auprès de &lt;a href=&quot;http://jerome.rocheteau.free.fr/&quot;&gt;Jérôme&lt;/a&gt; pour construire toute mon argumentation et ce billet sur une erreur qu'il a faite :) Pour information, Jérôme travaille en tant qu'ingénieur de recherche au sein de &lt;a href=&quot;http://www.lina.univ-nantes.fr/-TALN-.html&quot;&gt;notre équipe de recherche&lt;/a&gt;, et est très certainement la personne de l'équipe la plus impliquée et la plus compétente sur UIMA. Voilà pour la mise en garde, je peux désormais mettre en place l'inquisition et prononcer l&lt;em&gt;'auto da fé&lt;/em&gt; de sa méthode&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;L'erreur dont je parle est celle présentée dans &lt;a href=&quot;http://jerome.rocheteau.free.fr/index/post/2010/01/14/Comment-calculer-l-occurrence-des-mots-dans-un-document-et-dans-une-collection-avec-UIMA&quot;&gt;ce billet&lt;/a&gt;. En gros, Jérôme nous explique dans ce billet que pour compter le nombre de mots dans tous les documents d'une collection, à l'aide d'un AE, on procède en en trois temps&amp;nbsp;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;dans la méthode &lt;a href=&quot;http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/api/org/apache/uima/analysis_component/AnalysisComponent_ImplBase.html#initialize%28org.apache.uima.UimaContext%29&quot;&gt;initialize()&lt;/a&gt; on prépare la structure qui va nous permettre de collecter les données&lt;/li&gt;
&lt;li&gt;dans la méthode &lt;a href=&quot;http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/api/org/apache/uima/analysis_component/JCasAnnotator_ImplBase.html#process%28org.apache.uima.jcas.JCas%29&quot;&gt;process()&lt;/a&gt; on compte les termes et on alimente la structure initialisée dans le initialize()&lt;/li&gt;
&lt;li&gt;dans la méthode &lt;a href=&quot;http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/api/org/apache/uima/analysis_component/AnalysisComponent_ImplBase.html#collectionProcessComplete%28%29&quot;&gt;collectionProcessComplete()&lt;/a&gt; on fait un bilan de ce que l'on a collecté dans la fameuse structure et on renvoie tout à l'utilisateur.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;D'une manière générale, cela revient à dire que l'on peut définir une structure persistante dans un AE qui nous permette de stocker des informations relevant de tous les CAS. &lt;strong&gt;Ce raisonnement est entièrement faux, même s'il fonctionne en général.&lt;/strong&gt;&lt;/p&gt;


&lt;h2&gt;Du CPE et des &lt;em&gt;Processing pipelines&lt;/em&gt;&lt;/h2&gt;


&lt;p&gt;Tout d'abord il est peut-être nécessaire de rappeler ce qu'est &lt;a href=&quot;http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/html/tutorials_and_users_guides/tutorials_and_users_guides.html#ugr.tug.cpe.fig.cpe_components&quot;&gt;un CPE&lt;/a&gt;. Il s'agit de l'ensemble des composants (collection reader, analysis engines et CAS consumers) agencés pour produire et traiter les différents CAS. On peut en quelque sorte considérer qu'un CPE est une chaîne de traitement instanciée.&lt;/p&gt;


&lt;p&gt;Un CPE est orchestré par un CPM, ce dernier va se charger de la mise en œuvre de la chaîne&amp;nbsp;: instanciation des composants, appel des méthodes de l'API, distribution des CAS, suivi des erreurs, collecte d'informations statistiques sur le déroulement du traitement.&lt;/p&gt;


&lt;p&gt;Voilà donc pour la théorie générale, qui peut se résumer à ce schéma que j'emprunte gentiment aux gens d'Apache&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://www.fabienpoulard.info/public/UIMA/cpe-theorie.png&quot;&gt;&lt;img src=&quot;http://www.fabienpoulard.info/public/UIMA/.cpe-theorie_m.jpg&quot; alt=&quot;Représentation schématique d&amp;#039;un CPE&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Représentation schématique d&amp;#039;un CPE, juil. 2010&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Au regard de ce schéma on pourrait penser que la méthode décrite par Jérôme fonctionne puisqu'on a l'impression que les CAS produits ne passent au travers que d'une seule instance des AE. Si tel était le cas, l'intérêt de UIMA en termes de déploiement serait limité puisque cela reviendrait à transmettre la sortie d'un composant à l'entrée du composant suivant dans la chaîne. Une sorte &lt;em&gt;pipe&lt;/em&gt; entre les différentes briques logicielles.&lt;/p&gt;


&lt;p&gt;Il faut se pencher un peu plus profondément dans la configuration du CPE pour se rendre compte que le fonctionnement est bien mieux pensé que cela. Ainsi, on trouve dans &lt;a href=&quot;http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/html/references/references.html#ugr.ref.xml.cpe_descriptor.descriptor.cas_processors&quot;&gt;la section ''casProcessors''&lt;/a&gt;  des descripteurs (XML) de CPE, un attribut d'intérêt&amp;nbsp;: &lt;em&gt;processingUnitThreadCount&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;L'attribut &lt;em&gt;processingUnitThreadCount&lt;/em&gt; spécifie le nombre de &lt;em&gt;Processing pipelines&lt;/em&gt; (trad: chaînes de traitement ?) répliquées. Une &lt;em&gt;processing pipeline&lt;/em&gt; est composée de la séquence d'AE définissant le traitement à opérer. Ces séquences (et donc les AE associés) sont dupliqués autant de fois que le nombre précisé par l'attribut &lt;em&gt;processingUnitThreadCount&lt;/em&gt;, chacune s'exécutant dans son propre thread indépendamment des autres.&lt;/p&gt;


&lt;p&gt;Un petit schéma, encore une fois gentiment emprunté aux gens d'Apache, vaut mieux qu'un long discours&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://www.fabienpoulard.info/public/UIMA/cpe-detail.png&quot;&gt;&lt;img src=&quot;http://www.fabienpoulard.info/public/UIMA/.cpe-detail_m.jpg&quot; alt=&quot;Représentation schématique, plus précise, d&amp;#039;un CPE&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Représentation schématique, plus précise, d&amp;#039;un CPE, juil. 2010&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Le CPM prélève les CAS produit par le &lt;em&gt;collection reader&lt;/em&gt;, et stockées dans la queue d'entrée (de taille &lt;em&gt;casPoolSize&lt;/em&gt;), et les distribue dans les différentes &lt;em&gt;processing pipelines&lt;/em&gt;. Les CAS étant distribuées entre les différentes chaînes, un CAS donné ne passera que par une seule de ces chaînes&amp;nbsp;: c'est ici que la méthode de Jérôme échoue&amp;nbsp;! En effet, chaque AE dupliqué ne traite qu'un sous ensemble des CAS produits et alimente sa propre structure interne, sans connaissance des informations stockées dans les structures des autres instances de ce même AE.&lt;/p&gt;


&lt;h2&gt;L'avènement des ressources externes&lt;/h2&gt;


&lt;p&gt;Au sein de l'équipe nous avons déjà discuté brièvement des ressources externes. Cependant le contenu des discussions se résumait plus au mois à &lt;em&gt;les ressources on ne sait pas trop à quoi ça sert, par contre c'est ennuyeux car il faut éditer les descripteurs pour les préciser, donc on préfère les paramètres&lt;/em&gt;. Nous sommes passés à côté de l'essence même de ces dernières.&lt;/p&gt;


&lt;p&gt;La &lt;a href=&quot;http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/html/tutorials_and_users_guides/tutorials_and_users_guides.html#ugr.tug.aae.accessing_external_resource_files&quot;&gt;section 1.5.4 de la documentation ''Tutorials and users guides''&lt;/a&gt; décrit le fonctionnement et l'utilisation des ressources externes.&lt;/p&gt;


&lt;p&gt;Sometimes you may want an annotator to read from an external file – for example, a long list of keys and values that you are going to build into a HashMap. You could, of course, just introduce a configuration parameter that holds the absolute path to this resource file, and build the HashMap in your annotator's initialize method. However, this is not the best solution for three reasons:&lt;/p&gt;


&lt;p&gt;Les ressources externes ont deux avantages majeurs (à mon avis)&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Elles sont partagées entre toutes les instances du même AE (&lt;em&gt;cf. &lt;a href=&quot;http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/html/tutorials_and_users_guides/tutorials_and_users_guides.html#ugr.tug.aae.resources.sharing_among_annotators&quot;&gt;section 1.5.4.4&lt;/a&gt;&lt;/em&gt;);&lt;/li&gt;
&lt;li&gt;Elles peuvent implémenter une interface particulière et ainsi embarquer un &lt;em&gt;comportement&lt;/em&gt;&amp;nbsp;;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Il serait donc préférable dans le cas de Jérôme&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;soit d'empêcher le déploiement en parallèle de plusieurs instances du même AE&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;soit de passer par une ressource (une ArrayList par exemple)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;J'ai la lâcheté de ne pas proposer de correction, mais l'objectif de ce billet était simplement d'expliquer pourquoi l'utilisation de ressources externes pouvait se justifier et pourquoi la combinaison de structures internes et d'appel à la méthode &lt;em&gt;collectionProcessComplete&lt;/em&gt; n'était pas toujours suffisant.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/07/16/Du-bon-usage-des-ressources-dans-UIMA#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/07/16/Du-bon-usage-des-ressources-dans-UIMA#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/90</wfw:commentRss>
      </item>
    
  <item>
    <title>Installer Subclipse pour Eclipse Helios</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/07/13/Installer-Subclipse-pour-Eclipse-Helios</link>
    <guid isPermaLink="false">urn:md5:cb62b74373ce3da0b2443407e4f1a4df</guid>
    <pubDate>Tue, 13 Jul 2010 18:00:00 +0200</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Geek &amp; Technique</category>
        <category>debian</category><category>eclipse</category>    
    <description>    &lt;h2&gt;Installation d'Eclipse&lt;/h2&gt;


&lt;p&gt;Pour Debian Squeeze, Eclipse Helios n'est pas encore packagée. Je métais contenté de Galileo jusqu'à maintenant mais Subclipse a, pour une raison que je n'arrive toujours pas à m'expliquer, cessé de fonctionner. Après multiples vaines tentatives de retrouver un environnement de travail fonctionnel, j'ai aboutit à Eclipse Helios + Subclipse.&lt;/p&gt;


&lt;p&gt;J'ai choisi d'installer Eclipse dans mon home, l'installation dans &lt;em&gt;/opt&lt;/em&gt; ou un autre répertoire pour lequel mon utilisateur n'a pas les droits d'écriture s'étant avéré, encore une fois, problématique. Pour l'installation, rien de bien sorcier&amp;nbsp;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;On récupère l'archive qui va bien sur le &lt;a href=&quot;http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/heliosr&quot;&gt;site d'Eclipse&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;On décompresse dans son répertoire personnel&amp;nbsp;: &lt;code&gt;tar -czvf eclipse-java-helios-linux-gtk-x86_64.tar.gz -C ~/&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Suite à mes nombreuses expérimentations sans succès, je me suis permis de modifier plusieurs variables de configuration dans le &lt;em&gt;eclipse.ini&lt;/em&gt; de sorte qu'il ressemble désormais à ça&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.0.v20100503
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-debug
-consoleLog
-vm
/usr/lib/jvm/java-6-sun/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx384m
-Djava.net.preferIPv4Stack=true
-Djava.library.path=/usr/lib/jni
&lt;/pre&gt;


&lt;p&gt;Les éléments les plus importants étant&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;-debug&lt;/strong&gt; et &lt;strong&gt;-consoleLog&lt;/strong&gt; pour afficher plein de jolis messages d'information lorsqu'on lance l'application depuis une console&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;-vm /usr/lib/jvm/java-6-sun/bin/java&lt;/strong&gt; qui indiquer à Eclipse d'utiliser la JVM de Sun pour son exécution&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;-Djava.net.preferIPv4Stack=true&lt;/strong&gt; pour parer &lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/06/29/%22Le-r%C3%A9seau-n-est-pas-accessible%22-incongrue-dans-Eclipse-%28ou-n-importe-quelle-application-Java%29&quot;&gt;ce petit problème&lt;/a&gt;&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;-Djava.library.path=/usr/lib/jni&lt;/strong&gt; pour indiquer à la JVM où aller regarder pour les bibliothèques natives.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ce dernier point est le plus important, il est nécessaire pour la détection correcte de &lt;a href=&quot;http://subclipse.tigris.org/wiki/JavaHL&quot;&gt;javaHL&lt;/a&gt; par la suite.&lt;/p&gt;


&lt;h2&gt;Installation de Subclipse&lt;/h2&gt;


&lt;p&gt;Un truc vraiment sympa avec Eclipse Helios c'est l'apparition du &lt;em&gt;Eclipse Marketplace&lt;/em&gt;&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;Pour le lancer&amp;nbsp;: &lt;em&gt;Help &amp;gt; Eclipse Marketplace ...&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sélectionnez l&lt;em&gt;'Eclipse Marketplace&lt;/em&gt;. Il est possible que l'installation fonctionne également avec le catalogue de Yoxos, mais je ne l'ai pas testé.&lt;/li&gt;
&lt;li&gt;Dans le champs de recherche, tapez &lt;em&gt;Subclipse&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Dans la liste des résultats, sous l'entrée &lt;em&gt;Subclipse&lt;/em&gt;, cliquez sur &lt;em&gt;Install&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;... le reste suit la procédure habituelle d'installation de paquets, conservez toutes les entrées proposées.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Lorsque l'installation est terminée et avant de redémarrer Eclipse, vous devez installer la partie native de &lt;a href=&quot;http://subclipse.tigris.org/wiki/JavaHL&quot;&gt;JavaHL&lt;/a&gt;. Pour ce faire, sous Debian Squeeze&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
sudo aptitude install libsvn-java
&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Vérifiez bien que vous avez indiqué à la JVM comment accéder aux librairies natives&amp;nbsp;: entrée &lt;em&gt;-Djava.library.path=/usr/lib/jni&lt;/em&gt; dans le &lt;em&gt;eclipse.ini&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;Vous pouvez désormais relancer Eclipse. Faites un clique-droit dans l'explorateur de projets, puis un &lt;em&gt;Import&lt;/em&gt;. Vous devriez voir apparaître dans la liste un dossier &lt;em&gt;SVN&lt;/em&gt; contenant une entrée &lt;em&gt;Checkout Projects from SVN&lt;/em&gt;... vous n'avez plus qu'à suivre les instructions.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/07/13/Installer-Subclipse-pour-Eclipse-Helios#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/07/13/Installer-Subclipse-pour-Eclipse-Helios#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/89</wfw:commentRss>
      </item>
    
  <item>
    <title>&quot;Le réseau n'est pas accessible&quot; incongrue dans Eclipse (ou n'importe quelle application Java)</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/06/29/Le-r%C3%A9seau-n-est-pas-accessible-incongrue-dans-Eclipse-%28ou-n-importe-quelle-application-Java%29</link>
    <guid isPermaLink="false">urn:md5:edeff83b200ef35ff33a5cd3fe671130</guid>
    <pubDate>Tue, 29 Jun 2010 15:14:00 +0200</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Geek &amp; Technique</category>
        <category>debian</category><category>eclipse</category><category>java</category>    
    <description>    &lt;p&gt;Depuis ma dernière mise-à-jour dans &lt;a href=&quot;http://www.debian.org/releases/testing/&quot; hreflang=&quot;fr&quot;&gt;Debian Squeeze&lt;/a&gt;, je me suis aperçu qu'&lt;a href=&quot;http://www.eclipse.org&quot; hreflang=&quot;en&quot;&gt;Eclipse&lt;/a&gt; (ou bien n'importe quelle application Java) n'était plus en mesure de se connecter au réseau. L'application retourne inéluctablement le message &lt;em&gt;&quot;Le réseau n'est pas accessible&quot;&lt;/em&gt;, quand bien même toutes les autres applications se connectent sans problème.&lt;/p&gt;


&lt;p&gt;Apparemment ce comportement est dû à l'utilisation exclusive d'IPv6 dans Java (JVM Sun ou OpenJDK indifféremment)... ce qui sur les réseaux toujours en IPv4 ne mène à rien, et correspond effectivement à un réseau inaccessible.&lt;/p&gt;


&lt;p&gt;La solution consiste à passer l'option &lt;em&gt;-Djava.net.preferIPv4Stack=true&lt;/em&gt; à la JVM à son lancement. Pour Eclipse, il suffit d'ajouter cette ligne au fichier &lt;em&gt;eclipse.ini&lt;/em&gt; (&lt;em&gt;/etc/eclipse.ini&lt;/em&gt;) pour Debian.&lt;/p&gt;


&lt;p&gt;La discussion concernant ce bug chez Debian&amp;nbsp;: &lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560142&quot; hreflang=&quot;en&quot;&gt;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560142&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/06/29/Le-r%C3%A9seau-n-est-pas-accessible-incongrue-dans-Eclipse-%28ou-n-importe-quelle-application-Java%29#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/06/29/Le-r%C3%A9seau-n-est-pas-accessible-incongrue-dans-Eclipse-%28ou-n-importe-quelle-application-Java%29#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/88</wfw:commentRss>
      </item>
    
  <item>
    <title>Debian : échec du lancement des applications graphiques en root</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/06/22/Debian-%3A-%C3%A9chec-du-lancement-des-applications-graphiques-en-root</link>
    <guid isPermaLink="false">urn:md5:47ce61e3e69c878c320a8f49ef98eeb7</guid>
    <pubDate>Tue, 22 Jun 2010 21:05:00 +0200</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Geek &amp; Technique</category>
        <category>debian</category><category>linux</category>    
    <description>    &lt;p&gt;Je viens tout juste de quitter &lt;a href=&quot;http://www.ubuntulinux.com&quot;&gt;Ubuntu&lt;/a&gt; qui commençait sérieusement à m'agacer avec ses versions pas vraiment finies et ses mises-à-jour de version qui plantent tout. Alors je suis revenu sous la distribution reine&amp;nbsp;: &lt;a href=&quot;http://www.debian.org&quot;&gt;Debian&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Le premier petit accroc que je viens de rencontrer concerne le lancement de l'outil &lt;em&gt;update-manager&lt;/em&gt;. Lorsque que je le lance à partir de ma zone de notification, il m'invite à taper mon mot de passe afin de passer root et de s'exécuter, puis se crache lamentablement avec un &lt;em&gt;Failed to run update-manager as user root&lt;/em&gt;, suivi d'un petit &lt;em&gt;Failed to communicate with gksu-run-helper&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;Le problème vient de l'utilisation de &lt;em&gt;su&lt;/em&gt; pour l'authentification, il suffit de le remplacer par &lt;em&gt;sudo&lt;/em&gt;. Pour ce faire&amp;nbsp;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Lancez l'outil de configuration &lt;em&gt;gksu-properties&lt;/em&gt; (à partir d'une console)&lt;/li&gt;
&lt;li&gt;Placez l'entrée &lt;em&gt;Authentication mode&lt;/em&gt; sur &lt;em&gt;sudo&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Fermez, c'est corrigé :)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Je ne sais pas si c'est un problème dû à quelques fichiers de configurations restant d'Ubuntu dans mon home, mais c'est un peu gênant. Il faudrait peut-être le remonter aux développeurs Debian.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/06/22/Debian-%3A-%C3%A9chec-du-lancement-des-applications-graphiques-en-root#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/06/22/Debian-%3A-%C3%A9chec-du-lancement-des-applications-graphiques-en-root#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/87</wfw:commentRss>
      </item>
    
  <item>
    <title>51e billet... un peu de fun : mettre en place une fausse webcam sous Ubuntu</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/04/02/51e-billet...-un-peu-de-fun-%3A-mettre-en-place-une-fausse-webcam-sous-Ubuntu</link>
    <guid isPermaLink="false">urn:md5:de8927cb5dbafe8c730fceb8a65f687e</guid>
    <pubDate>Fri, 02 Apr 2010 00:44:00 +0200</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Geek &amp; Technique</category>
        <category>geek</category><category>hack</category><category>ubuntu</category>    
    <description>&lt;p&gt;Pour mon 51e billet sur ce blog, je me suis dit que j'allais faire quelque chose d'un peu plus détendu que d'habitude. Voici un petit tutoriel pour installer une fausse webcam sous Ubuntu Karmic.&lt;/p&gt;


&lt;p&gt;À quoi ça sert une fausse webcam&amp;nbsp;? Potentiellement à plusieurs choses&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Faire passer le flux de votre vraie webcam qui n'est pas reconnue par Flash dans une fausse reconnue elle par Flash (cherchez pas ^^)&lt;/li&gt;
&lt;li&gt;Balancer votre dernier film de vacance en streaming à votre mamie par la webcam, sans mettre en place de choses compliquées&lt;/li&gt;
&lt;li&gt;Faire croire à votre rencard internet que vous êtes Bard Pitt (ou Angelina Jolie... c'est selon le rencard)&lt;/li&gt;
&lt;/ul&gt;    &lt;p&gt;Pour ce tour de passe-passe numérique j'utilise le logiciel &lt;a href=&quot;http://www.ws4gl.org/&quot; hreflang=&quot;en&quot;&gt;WebcamStudio&lt;/a&gt;. Le principe est assez simple, ça crée un faux périphérique V4L qui transmet le flux vidéo que vous souhaitez.&lt;/p&gt;


&lt;p&gt;La première étape est d'ajouter le dépôt qui va bien dans '/etc/apt/sources.list''&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
deb http://apt.dolphinaura.studenthotspot.net/ jaunty main
&lt;/pre&gt;


&lt;p&gt;Même si c'est marqué &lt;em&gt;jaunty&lt;/em&gt;, le paquet fonctionne pour Karmic. C'est l'avantage d'avoir assez peu de dépendances (gstreamer mis à part). Ensuite ajoutez la clé du développeur&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 44F9E03A
&lt;/pre&gt;


&lt;p&gt;Vous pouvez alors faire une mise à jour de la liste des paquets et vérifier que le paquet &lt;em&gt;webcamstudio&lt;/em&gt; est présent&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ sudo aptitude update
...
$ aptitude show webcamstudio
&lt;/pre&gt;


&lt;p&gt;Vous pouvez maintenant l'installer&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ sudo aptitude install webcamstudio
&lt;/pre&gt;


&lt;p&gt;Une fois l'installation effectuée, ajoutez-vous au groupe &lt;em&gt;video&lt;/em&gt; (manuellement en éditant &lt;em&gt;/etc/group&lt;/em&gt; ou bien à l'aide des outils graphiques).&lt;/p&gt;


&lt;p&gt;Vous pouvez alors l'application après vous êtes assuré que vous apparteniez bien au groupe &lt;em&gt;video&lt;/em&gt;&amp;nbsp;: soit en passant par le menu, soit en tapant &lt;em&gt;webcamstudio&lt;/em&gt; dans une console.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/04/02/51e-billet...-un-peu-de-fun-%3A-mettre-en-place-une-fausse-webcam-sous-Ubuntu#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/04/02/51e-billet...-un-peu-de-fun-%3A-mettre-en-place-une-fausse-webcam-sous-Ubuntu#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/86</wfw:commentRss>
      </item>
    
  <item>
    <title>Parcours des annotations couvertes par une autre annotation</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/04/01/Parcours-des-annotations-couvertes-par-une-autre-annotation</link>
    <guid isPermaLink="false">urn:md5:0680eb8840686773ad766f9be3e2b99d</guid>
    <pubDate>Thu, 01 Apr 2010 11:11:00 +0200</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Sciences &amp; Recherche</category>
        <category>uima</category>    
    <description>&lt;p&gt;Lorsque l'on travaille avec &lt;a href=&quot;http://incubator.apache.org/uima/&quot; hreflang=&quot;en&quot;&gt;Apache UIMA&lt;/a&gt; et que l'on ajoute un nombre important d'annotations, il arrive un moment où l'on va vouloir filtrer certaines de ces annotations en fonction d'autres. Ainsi, assez couramment on éprouve le besoin de devoir récupérer des annotations qui couvrent la même zone de texte qu'une autre. Par exemple&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;récupérer les mots contenus dans une phrases&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;récupérer les paragraphes dans un document&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Il y a au moins deux approches dans Apache UIMA qui permettent de répondre à ce besoin&amp;nbsp;: le &lt;a href=&quot;http://incubator.apache.org/uima/apidocs/org/apache/uima/cas/text/AnnotationIndex.html#subiterator%28org.apache.uima.cas.text.AnnotationFS%29&quot; hreflang=&quot;en&quot;&gt;subiterator&lt;/a&gt; et le &lt;a href=&quot;http://incubator.apache.org/uima/apidocs/org/apache/uima/cas/FSMatchConstraint.html&quot; hreflang=&quot;en&quot;&gt;FSMatchConstraint&lt;/a&gt;.&lt;/p&gt;    &lt;h2&gt;Utilisation du subiterator&lt;/h2&gt;


&lt;p&gt;L'approche basée sur le subiterator ne peut fonctionner que si les types que l'on cherche à accéder sont couverts par le type couvrant au sens de UIMA, c-à-d en terme de priorité des types (cf. &lt;a href=&quot;http://incubator.apache.org/uima/downloads/releaseDocs/2.3.0-incubating/docs/api/org/apache/uima/resource/metadata/TypePriorities.html&quot; hreflang=&quot;en&quot;&gt;[la javadoc de TypePriorities&lt;/a&gt;] ou &lt;a href=&quot;http://osdir.com/ml/apache.uima.general/2008-03/msg00030.html&quot;&gt;cet email&lt;/a&gt;).&lt;/p&gt;


&lt;p&gt;Considérons une annotation A qui couvre des annotations B de la manière suivante&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
Il y a du texte et les annotations sont sur ce texte ...
[-----A:1-----]   [---A:2---]  [--------A:3--------]
 [B:1] [B:2]       [B:3]        [B:4]  [B:5] [B:6]
&lt;/pre&gt;


&lt;p&gt;Dans l'exemple ci-dessus, nous sommes intéressés par les annotations B couvertes par l'annotation A:3, en d'autres termes les annotations B:4, B:5 et B:6.&lt;/p&gt;


&lt;p&gt;La méthode est la suivante&amp;nbsp;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;On récupère un pointeur sur l'annotation couvrante qui nous intéresse (A:3), à l'aide d'un itérateur par exemple&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;On récupére l'index des annotations couvertes (les B)&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;On appelle la méthode subiterator de l'index des annotations couvertes (B) en passant en paramètre l'annotation couvrante (A:3), la méthode nous retourne un itérateur sur les annotations B couvertes par A:3, soit B:4, B:5 et B:6.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Voici le code correspondant&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;java&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Récupération des index&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;AnnotationIndex annAIdx = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;AnnotationIndex&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; jcas.&lt;span style=&quot;color: #006600;&quot;&gt;getAnnotationIndex&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;A.&lt;span style=&quot;color: #006600;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;AnnotationIndex annBIdx = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;AnnotationIndex&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; jcas.&lt;span style=&quot;color: #006600;&quot;&gt;getAnnotationIndex&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;B.&lt;span style=&quot;color: #006600;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// On recherche ''A:3''&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;FSIterator annAIt = annAIdx.&lt;span style=&quot;color: #006600;&quot;&gt;iterator&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;while&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;annAIt.&lt;span style=&quot;color: #006600;&quot;&gt;hasNext&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  A monA3 = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;A&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; annAIt.&lt;span style=&quot;color: #006600;&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// On récupére l'itérateur sur les annotations B couvertes par A3&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  FSIterator annBSousA3It = annBIdx.&lt;span style=&quot;color: #006600;&quot;&gt;subiterator&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;monA3&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #b1b100;&quot;&gt;while&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;annBSousA3It.&lt;span style=&quot;color: #006600;&quot;&gt;hasNext&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// On récupére successivement B4, B5 et B6&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    B annB = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;B&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; annBSousA3It.&lt;span style=&quot;color: #006600;&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;out&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Sous A3 : &amp;quot;&lt;/span&gt;+annB&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;h3&gt;Utilisation des contraintes (FSMatchConstraint)&lt;/h3&gt;


&lt;p&gt;Lorsque l'on ne connaît pas les priorités des types ou bien qu'elles ne correspondent pas à ce que l'on souhaite faire, il est nécessaire de passer par un mécanisme plus complexe (mais beaucoup plus puissant)&amp;nbsp;: le système de contraintes d'index.&lt;/p&gt;


&lt;p&gt;Dans le cas présent, nous allons définir &lt;a href=&quot;http://incubator.apache.org/uima/downloads/releaseDocs/2.3.0-incubating/docs/api/org/apache/uima/cas/ConstraintFactory.html&quot; hreflang=&quot;en&quot;&gt;une contrainte&lt;/a&gt; imposant que les attributs &lt;em&gt;begin&lt;/em&gt; et &lt;em&gt;end&lt;/em&gt; d'une annotation d'un type donné correspondent à une certaine valeur&amp;nbsp;: celle de l'annotation couvrante. Puis nous pourrons générer un itérateur qui retournera les annotations de l'index qui respectent cette contrainte.&lt;/p&gt;


&lt;p&gt;Voici l'implémentation d'une méthode qui fait cela&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;java&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* This method provides an iterator over typed annotations that either &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* have an offset embedded in that of a given annotation in a document, &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* or have the same offset as these annotation. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* @param theDocument  the document in which stand the source and&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*                                         target annotations&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* @param theAnnotation  the source annotation under which target &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*                                         annotations that have to be drawn out&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* @param theType            the type of the target annotations that have &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*                                         to be drawn out from the document under &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*                                         the source annotation&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* @param isStrict              the boolean that defines the offset matching,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*                                         offsets strictly equal if isStrict is true, begin &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*                                         offsets greater or equal and end offsets less &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*                                         or equal otherwise.  	&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* @return                           the iterator over the type theType annotations &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*                                          which stand under the annotation theAnnotation &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*                                          in the document theDocument &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* @author Fabien Poulard&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* @author Jérôme Rocheteau&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* @license Apache 2.0&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; FSIterator subiterator&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;JCas theDocument, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;Annotation&lt;/span&gt; theAnnotation,Type theType,&lt;span style=&quot;color: #993333;&quot;&gt;boolean&lt;/span&gt; isStrict&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Ajout: déclaration de la variable type&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	Type theAnnotationType = theAnnotation.&lt;span style=&quot;color: #006600;&quot;&gt;getType&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// On utilise le constraint factory&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	ConstraintFactory theConstraints = theDocument.&lt;span style=&quot;color: #006600;&quot;&gt;getConstraintFactory&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// On définit les contraintes sur le début de l'annotation&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	FSIntConstraint beginConstraint = theConstraints.&lt;span style=&quot;color: #006600;&quot;&gt;createIntConstraint&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;isStrict&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;		beginConstraint.&lt;span style=&quot;color: #006600;&quot;&gt;eq&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;theAnnotation.&lt;span style=&quot;color: #006600;&quot;&gt;getBegin&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;		beginConstraint.&lt;span style=&quot;color: #006600;&quot;&gt;geq&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;theAnnotation.&lt;span style=&quot;color: #006600;&quot;&gt;getBegin&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	Feature beginFeature = theAnnotationType.&lt;span style=&quot;color: #006600;&quot;&gt;getFeatureByBaseName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;begin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	FeaturePath beginPath = theDocument.&lt;span style=&quot;color: #006600;&quot;&gt;createFeaturePath&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	beginPath.&lt;span style=&quot;color: #006600;&quot;&gt;addFeature&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;beginFeature&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	FSMatchConstraint begin = theConstraints.&lt;span style=&quot;color: #006600;&quot;&gt;embedConstraint&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;beginPath,beginConstraint&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// ... puis sur la fin de l'annotation&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	FSIntConstraint endConstraint = theConstraints.&lt;span style=&quot;color: #006600;&quot;&gt;createIntConstraint&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;isStrict&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;		endConstraint.&lt;span style=&quot;color: #006600;&quot;&gt;eq&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;theAnnotation.&lt;span style=&quot;color: #006600;&quot;&gt;getEnd&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;		endConstraint.&lt;span style=&quot;color: #006600;&quot;&gt;leq&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;theAnnotation.&lt;span style=&quot;color: #006600;&quot;&gt;getEnd&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	Feature endFeature = theAnnotationType.&lt;span style=&quot;color: #006600;&quot;&gt;getFeatureByBaseName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;end&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	FeaturePath endPath = theDocument.&lt;span style=&quot;color: #006600;&quot;&gt;createFeaturePath&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	endPath.&lt;span style=&quot;color: #006600;&quot;&gt;addFeature&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;endFeature&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	FSMatchConstraint end = theConstraints.&lt;span style=&quot;color: #006600;&quot;&gt;embedConstraint&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;endPath, endConstraint&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// JR: on définit une contrainte sur le type d'annotation&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	FSTypeConstraint typeConstraint = theConstraints.&lt;span style=&quot;color: #006600;&quot;&gt;createTypeConstraint&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	typeConstraint.&lt;span style=&quot;color: #006600;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;theType&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	FeaturePath typePath = theDocument.&lt;span style=&quot;color: #006600;&quot;&gt;createFeaturePath&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	FSMatchConstraint type = theConstraints.&lt;span style=&quot;color: #006600;&quot;&gt;embedConstraint&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;typePath, typeConstraint&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// On combine les contraintes&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	FSMatchConstraint beginAndEnd = theConstraints.&lt;span style=&quot;color: #006600;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;type,theConstraints.&lt;span style=&quot;color: #006600;&quot;&gt;and&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;begin, end&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// On génère un itérateur respectant ces contraintes&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	FSIterator filteredIterator =&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	theDocument.&lt;span style=&quot;color: #006600;&quot;&gt;createFilteredIterator&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;theDocument.&lt;span style=&quot;color: #006600;&quot;&gt;getAnnotationIndex&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;iterator&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, beginAndEnd&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; filteredIterator&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Cette méthode prend en paramètre le JCas dans lequel travailler, l'annotation couvrante (l'annotation A3 dans l'exemple précédent), le type d'annotation qui nous intéresse (le type B pour reprendre l'exemple précédent) et un booléen qui permet de préciser si l'on souhaite une correspondance exacte ou approximative des frontières.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/04/01/Parcours-des-annotations-couvertes-par-une-autre-annotation#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/04/01/Parcours-des-annotations-couvertes-par-une-autre-annotation#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/85</wfw:commentRss>
      </item>
    
  <item>
    <title>Tests unitaires pour UIMA avec UUTUC</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/03/16/Tests-unitaires-pour-UIMA-avec-UUTUC</link>
    <guid isPermaLink="false">urn:md5:d946fd038fb8079465506d73120e50ca</guid>
    <pubDate>Tue, 16 Mar 2010 15:45:00 +0100</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Sciences &amp; Recherche</category>
        <category>java</category><category>testing</category><category>these</category><category>uima</category>    
    <description>&lt;p&gt;La qualité du code  développé dans le cadre des activités de recherche scientifique n'est pas toujours aussi bon qu'on pourrait l'espérer. Outre &lt;a href=&quot;http://www.framablog.org/index.php/post/2010/03/07/recherche-scientifique-code-informatique&quot; hreflang=&quot;fr&quot;&gt;la nécessité (évidente à mes yeux) d'ouvrir le codes des activités scientifiques&lt;/a&gt; financées par l'État et les collectivités territoriales, il est également nécessaire de suivre de bonnes pratiques de programmation. L'écriture de tests unitaires et leur exécution régulière est une de ces bonnes pratiques.&lt;/p&gt;


&lt;p&gt;Je présente dans ce billet un cas d'utilisation de la bibliothèque &lt;a href=&quot;http://code.google.com/p/uutuc/&quot; hreflang=&quot;en&quot;&gt;UUTUC&lt;/a&gt;, présentée lors du &lt;a href=&quot;http://www.aclweb.org/anthology/W/W09/#1500&quot; hreflang=&quot;en&quot;&gt;Workshop sur l'Ingénierie Logiciel, les Tests et l'Assurance Qualité pour le Traitement des Langues Naturelles (SETQA-NLP 2009)&lt;/a&gt;, pour tester l'implémentation d'une bibliothèque développée et utilisée dans le cadre de ma thèse (tddts-uima-shingling).&lt;/p&gt;    &lt;h2&gt;Principe de UUTUC&lt;/h2&gt;


&lt;p&gt;&lt;a href=&quot;http://code.google.com/p/uutuc/&quot; hreflang=&quot;en&quot;&gt;UUTUC&lt;/a&gt; est une bibliothèque offrant un certain nombre de méthodes facilitant le processus de test des composants UIMA. On y trouve notamment un certain nombre de classes de type &lt;em&gt;&lt;a href=&quot;http://fr.wikipedia.org/wiki/Fabrique_%28patron_de_conception%29&quot; hreflang=&quot;fr&quot;&gt;Factory&lt;/a&gt;&lt;/em&gt; qui facilitent la mise en place de chaînes de traitement simples pour expérimenter les composants.&lt;/p&gt;


&lt;p&gt;À l'aide de ces classes, l'exécution d'un AE sur un simple fichier texte se résume à ces quelques lignes&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;java&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;AnalysisEngine engine = &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  AnalysisEngineFactory.&lt;span style=&quot;color: #006600;&quot;&gt;createAnalysisEngineFromPath&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;descriptors/tutorial/ex1/RoomNumberAnnotator.xml&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;JCas jCas = &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  AnalysisEngineFactory.&lt;span style=&quot;color: #006600;&quot;&gt;process&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;engine, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;data/WatsonConferenceRooms.txt&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Le couplage de UUTUC avec &lt;a href=&quot;http://www.junit.org/&quot; hreflang=&quot;en&quot;&gt;JUnit&lt;/a&gt; permet de mettre en place un banc de tests unitaires&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Afin de tester la conformité de l'implémentation avec les spécifications attendues&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Prévenir les problèmes de régression lors de l'évolution des composants&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Écriture de tests unitaires&lt;/h2&gt;


&lt;p&gt;J'utilise le framework JUnit 4 pour les tests unitaires. Il suffit de faire précéder les méthodes considérées comme des tests par &lt;em&gt;@Test&lt;/em&gt; pour qu'elles soient reconnues comme telles par JUnit. Exemple&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;java&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.junit.Test;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #a1a100;&quot;&gt;import static org.junit.Assert.*;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* This class defines the tests for the main methods of the Shingle class.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; ShingleTest &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  ...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;  * This method just checks that the isComplete method works&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;  * @throws InvalidShingleException &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;  * @throws OverloadShingleException &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;  */&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  @Test&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; completeness&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;throws&lt;/span&gt; InvalidShingleException, OverloadShingleException &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	Shingle s1 = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Shingle&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	assertFalse&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; s1.&lt;span style=&quot;color: #006600;&quot;&gt;isComplete&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// before any adding&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	s1.&lt;span style=&quot;color: #006600;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; theShingleItems&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	assertFalse&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; s1.&lt;span style=&quot;color: #006600;&quot;&gt;isComplete&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// after a first adding&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	s1.&lt;span style=&quot;color: #006600;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; theShingleItems&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	assertTrue&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; s1.&lt;span style=&quot;color: #006600;&quot;&gt;isComplete&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// should be complete by now&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  ...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Combiné à UUTUC, il permet de mettre en place un environnement UIMA assez simplement. Ainsi dans l'exemple ci-dessous, nous définissons une méthode à exécuter avant chaque test (&lt;em&gt;@Before&lt;/em&gt;) qui crée un JCas et y ajoute quelques annotations à l'aide des Factory de UUTUC&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;java&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/** Static data for testing */&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; CAS_CONTENT = &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Suisse : inauguration d'une nouvelle synagogue, une première depuis 50 ans&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;Integer&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; CAS_OFFSETS = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;, &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;9&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;21&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;, &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;22&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;, &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;24&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;27&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;, &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;28&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;36&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;, &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;37&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;46&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;, &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;48&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;51&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;, &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;52&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;, &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;61&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;67&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;, &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;68&lt;/span&gt;,&lt;span style=&quot;color: #cc66cc;&quot;&gt;74&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* This method is used to set up the testing environment, creating the&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* data necessary for the different tests methods.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;@Before &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; setUp&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;throws&lt;/span&gt; UIMAException, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;IOException&lt;/span&gt;, ShinglingTestingException &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Set up a CAS with a couple of shingle items in&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	TypeSystemDescription tsd = TypeSystemDescriptionFactory&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;			.&lt;span style=&quot;color: #006600;&quot;&gt;createTypeSystemDescription&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;shingling-ts&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	theTestingCas = JCasFactory.&lt;span style=&quot;color: #006600;&quot;&gt;createJCas&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;tsd&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	theTestingCas.&lt;span style=&quot;color: #006600;&quot;&gt;setDocumentText&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;CAS_CONTENT&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;Integer&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; idx: CAS_OFFSETS&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;		AnnotationFactory.&lt;span style=&quot;color: #006600;&quot;&gt;createAnnotation&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;theTestingCas, &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;						idx&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;, idx&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;, ShingleItem.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Malheureusement il y a assez peu de documentation concernant UUTUC. Il est ainsi régulièrement nécessaire d'aller jeter un œil &lt;a href=&quot;http://code.google.com/p/uutuc/source/browse/trunk/uutuc/src/main/java/org/uutuc/factory/&quot;&gt;au code source&lt;/a&gt; qui heureusement est très bien écrit.&lt;/p&gt;


&lt;h2&gt;Intégration avec Maven&lt;/h2&gt;


&lt;p&gt;Maven modélisant toutes les étapes du cycle de développement, il intègre une étape &lt;em&gt;test&lt;/em&gt; entre le &lt;em&gt;compile&lt;/em&gt; et le &lt;em&gt;package&lt;/em&gt;. La gestion des tests unitaires se faisant quant à eux au travers du plugin &lt;a href=&quot;http://maven.apache.org/plugins/maven-surefire-plugin/&quot; hreflang=&quot;en&quot;&gt;maven-surefire-plugin&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Il faut tout d'abord rajouter dans le &lt;em&gt;pom.xml&lt;/em&gt; les informations de dépendance sur UUTUC et JUnit&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;xml&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;repository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;snapshots&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;enabled&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;false&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/enabled&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/snapshots&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;uutuc-googlecode&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;uutuc Google Code repository&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;http://uutuc.googlecode.com/svn/repo/&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/repository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- UUTUC for testing --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;org.uutuc&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;uutuc&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;0.9.10&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;optional&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;false&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/optional&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;scope&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;test&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/scope&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- JUnit 4 for testing --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;junit&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;junit&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;4.3.1&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;scope&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;test&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/scope&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Il suffit ensuite de faire appel au plugin &lt;em&gt;maven-surefire-plugin&lt;/em&gt; qui prend en charge tout ce qui concerne les tests, sous réserve que ces derniers soient bien présents dans &lt;em&gt;src/test/java&lt;/em&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;xml&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- Testing --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;plugin&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;org.apache.maven.plugins&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;maven-surefire-plugin&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;configuration&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;reportFormat&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;brief&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/reportFormat&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;useFile&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;false&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/useFile&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/configuration&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/plugin&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Il est alors possible de lancer l'exécution des tests avec Maven&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ mvn test
...
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running tddts.uima.shingling.ShingleTest
Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.992 sec

Results :

Tests run: 16, Failures: 0, Errors: 0, Skipped: 0
...
&lt;/pre&gt;


&lt;p&gt;Plus d'excuse pour ne pas tester votre code maintenant&amp;nbsp;! L'excuse de faire du prototypage pour la recherche n'en est pas une bonne dès que les résultats que vous publiez dépendent de la qualité dudit code. C'est votre intégrité et honnêteté scientifique qui est en jeux ;)&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/03/16/Tests-unitaires-pour-UIMA-avec-UUTUC#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/03/16/Tests-unitaires-pour-UIMA-avec-UUTUC#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/84</wfw:commentRss>
      </item>
    
  <item>
    <title>Corpus des discours de Nicolas Sarkozy (MÀJ)</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/03/13/Corpus-des-discours-de-Nicolas-Sarkozy-%28M%C3%80J%29</link>
    <guid isPermaLink="false">urn:md5:6d399d20d91a3e0b88912797bec9edf1</guid>
    <pubDate>Sat, 13 Mar 2010 23:08:00 +0100</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Sciences &amp; Recherche</category>
        <category>corpus</category>    
    <description>&lt;p&gt;Dans &lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2009/11/08/Corpus-des-discours-de-Nicolas-Sarkozy&quot;&gt;ce billet&lt;/a&gt;, j'avais distribué un corpus des discours de Nicolas Sarkozy. Depuis, le président a bien entendu prononcé un certain nombre de nouveaux discours. J'ai complété le corpus constitué à l'époque en conséquence.&lt;/p&gt;    &lt;p&gt;Ces différents discours sont disponibles sur &lt;a href=&quot;http://www.elysee.fr&quot; hreflang=&quot;fr&quot;&gt;le site de l'Élysée&lt;/a&gt;, leur téléchargement, utilisation et distribution sont permis. En effet, les discours publics ne sont couverts par aucun droit d'auteur (&lt;em&gt;cf. &lt;a href=&quot;http://elysee.fr/mentionslegales/&quot; hreflang=&quot;fr&quot;&gt;mentions légales d'Elysee.fr&lt;/a&gt; et &lt;a href=&quot;http://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000020740486&amp;amp;cidTexte=LEGITEXT000006069414&amp;amp;dateTexte=20091108&quot; hreflang=&quot;fr&quot;&gt;article L.122-5 du Code de Propriété intellectuelle&lt;/a&gt; alinéa 3c&lt;/em&gt;).&lt;/p&gt;


&lt;p&gt;Le corpus en lui-même est placé sous licence &lt;a href=&quot;http://www.cnrtl.fr/lexiques/prolex/licence_lgpl-lr.php&quot; hreflang=&quot;fr&quot;&gt;LGPL-LR&lt;/a&gt; en tant qu'œuvre dérivée des discours originaux. Merci donc de respecter cette licence et de me citer si jamais vous utilisez le corpus tel quel. Le corpus distribué contient&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;les discours originaux au format PDF&lt;/li&gt;
&lt;li&gt;une conversion propre des discours originaux en texte brut&lt;/li&gt;
&lt;li&gt;un nettoyage et une structuration XML des discours (extraction des titres, de la date, ...)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Le tout réorganisé chronologiquement. Les fichiers sont en effet préfixés de la date de prononciation du discours.&lt;/p&gt;


&lt;p&gt;Je distribue deux versions du corpus&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://dl.fabienpoulard.info/Recherche/Corpus/Discours-Sarkozy-v20100313.tar.gz&quot; hreflang=&quot;fr&quot;&gt;version complète&lt;/a&gt; (61Mo)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://dl.fabienpoulard.info/Recherche/Corpus/Discours-Sarkozy-nopdf-v20100313.tar.gz&quot; hreflang=&quot;fr&quot;&gt;version sans les PDF&lt;/a&gt; (5,3MMo)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;J'ai placé dans les fichiers d'archive un fichier contenant tous les liens vers les versions originales en PDF des discours sur le site de l'Élysée. Préférez donc la version sans PDF étant donné que vous pourrez facilement récupérer ces derniers sur le site de l'Élysée qui a une meilleur bande passante à mon avis&amp;nbsp;!&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/03/13/Corpus-des-discours-de-Nicolas-Sarkozy-%28M%C3%80J%29#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/03/13/Corpus-des-discours-de-Nicolas-Sarkozy-%28M%C3%80J%29#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/83</wfw:commentRss>
      </item>
    
  <item>
    <title>Utiliser Bazaar au travers de Web DAV</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/03/09/Utiliser-Bazaar-au-travers-de-Web-DAV</link>
    <guid isPermaLink="false">urn:md5:99ce5a143f7637a7878c86dbbb1ffd29</guid>
    <pubDate>Tue, 09 Mar 2010 14:42:00 +0100</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Geek &amp; Technique</category>
        <category>administration</category><category>bazaar</category><category>enseignement</category>    
    <description>&lt;p&gt;Dans le cadre de mon cours sur les outils pour le travail collaboratif, je fais travailler tous mes étudiants ensembles sur un même projet. Ces derniers sont alors invités (fortement) à utiliser plusieurs outils dans le cadre de leur collaboration&amp;nbsp;: messagerie instantanée (&lt;a href=&quot;http://fr.wikipedia.org/wiki/Internet_Relay_Chat&quot; hreflang=&quot;fr&quot;&gt;IRC&lt;/a&gt;), wiki et gestionnaire de tickets (&lt;a href=&quot;http://trac.edgewall.org/&quot; hreflang=&quot;en&quot;&gt;Trac&lt;/a&gt;) et un gestionnaire de version décentralisé (&lt;a href=&quot;http://bazaar.canonical.com/en/&quot; hreflang=&quot;en&quot;&gt;bazaar&lt;/a&gt;).&lt;/p&gt;


&lt;p&gt;Avant je leur faisais utiliser subversion qui a &lt;a href=&quot;http://subversion.apache.org/faq.html#apache-extension&quot; hreflang=&quot;en&quot;&gt;un module Apache dédié&lt;/a&gt; et qui est pris en charge par défaut dans Trac. La nouveauté de cette année c'est l'utilisation de Bazaar...&lt;/p&gt;    &lt;h2&gt;Pourquoi un serveur pour Bazaar&amp;nbsp;?&lt;/h2&gt;


&lt;p&gt;Contrairement à subversion, Bazaar est un gestionnaire de version décentralisé, ce qui signifie qu'il n'existe pas &lt;em&gt;a priori&lt;/em&gt; de dépôt de référence auquel se réfèrent tous les développeurs. Au contraire, chaque développeur possède son propre dépôt (sa propre branche) et l'échange de code entre développeurs se fait par des &lt;em&gt;merge&lt;/em&gt; des branches des deux développeurs.&lt;/p&gt;


&lt;p&gt;J'ai toutefois fait le choix de proposer aux étudiants de pouvoir héberger leur branche sur un serveur. Ces derniers sont en effet baladés entre les différentes salles de travaux pratiques et entre leurs machines personnelles. Il aurait été possible de leur faire placer leur dépôt sur une clef usb, mais le choix du serveur me semble plus pertinent pour plusieurs raisons&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Je garde une trace de toutes leurs activités, ce qui m'aide dans la notation du projet&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Ils ne peuvent pas égarer le serveur, contrairement à la clé usb&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Pédagogiquement ceci leur permet de se confronter aux notions de branches parentes et ainsi distinguer le &lt;em&gt;push&lt;/em&gt; du &lt;em&gt;commit&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Pourquoi Web DAV&amp;nbsp;?&lt;/h2&gt;


&lt;p&gt;Il existe plusieurs possibilités pour &lt;a href=&quot;http://doc.bazaar.canonical.com/bzr.1.3/en/user-guide/index.html#running-a-smart-server&quot; hreflang=&quot;en&quot;&gt;faire tourner un serveur bazaar&lt;/a&gt;, la plus simple étant très certainement d'encapsuler les commandes du protocole bazaar dans une connexion ssh. Toutefois cette solution n'était pas souhaitable pour deux raisons&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Les connexions ssh ne passent pas depuis les salles de TP&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Je ne voulais pas offrir un accès ssh à mon serveur aux étudiants&amp;nbsp;;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Je me suis donc tourné vers l'encapsulation dans HTTP qui reste tout de même le protocole passe partout.&lt;/p&gt;


&lt;h2&gt;Mise en place&lt;/h2&gt;


&lt;h3&gt;Activation de l'accès DAV&lt;/h3&gt;


&lt;p&gt;Tout d'abord, il faut activer l'accès DAV au répertoire qui contiendra les différentes branches bazaar. Ceci se fait dans Apache 2 en plusieurs temps.&lt;/p&gt;


&lt;p&gt;Tout d'abord, il faut activer le module &lt;em&gt;dav_fs&lt;/em&gt; qui est normalement installé par défaut (si ce n'est pas le cas, installez-le)&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ sudo a2enmod dav_fs
 Considering dependency dav for dav_fs:
 Module dav already enabled
 Enabling module dav_fs.
$ sudo /etc/init.d/apache2 restart
...
&lt;/pre&gt;


&lt;p&gt;Il faut ensuite déclarer le répertoire à exporter par DAV, en éditant le fichier de configuration de votre virtual host&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
  #########
  #         Depots Bazaar
  Alias /bzr /home/www-data/bzr_repositories
  &amp;lt;Location /bzr&amp;gt;
    Dav On
    # Bzr specific
    DirectorySlash Off
    DavDepthInfinity on
    # Auth
    AuthName DAV
    AuthBasicProvider file
    AuthzGroupFileAuthoritative On
    AuthUserFile /vers/le/fichier/htpasswds
    AuthGroupFile /vers/le/fichier/htgroups
    # Only for authenticated users
    Require valid-user
   &amp;lt;/Location&amp;gt;
&lt;/pre&gt;


&lt;p&gt;et recharger la configuration d'Apache&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ sudo /etc/init.d/apache2 reload
&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Attention&lt;/strong&gt; pour que cette configuration fonctionne, il faut que l'URI &lt;em&gt;/bzr&lt;/em&gt; soit accessible. Par exemple, si vous utilisez Trac et que ce dernier surveille l'URI racine &lt;em&gt;/&lt;/em&gt;, vous ne pourrez jamais accéder à &lt;em&gt;/bzr&lt;/em&gt;.&lt;/p&gt;


&lt;h3&gt;Dépôt partagé&lt;/h3&gt;


&lt;p&gt;Étant donné que les étudiants vont partager entre leurs branches une grosse partie du code, il semble pertinent de tirer parti d'un &lt;a href=&quot;http://doc.bazaar.canonical.com/bzr.1.3/en/tutorials/centralized_workflow.html#setting-up-a-local-repository&quot; hreflang=&quot;en&quot;&gt;dépôt partagé&lt;/a&gt;. Ce dernier se crée directement sur le serveur&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ cd racine/du/depot/
$ bzr init-repo --trees .
&lt;/pre&gt;


&lt;p&gt;Personnellement bzr me retourne une erreur &lt;em&gt;No handlers could be found for logger &quot;bzr&quot;&lt;/em&gt;, mais elle semble sans incidence. Une fois le dépôt partagé créé, il faut créer les &quot;véritables&quot; dépôts&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ cd racine/du/depot/
$ bzr init dev
&lt;/pre&gt;


&lt;h2&gt;Utilisation&lt;/h2&gt;


&lt;p&gt;Par défaut, &lt;em&gt;bzr&lt;/em&gt; ne gère pas l'accès par WebDAV, il est nécessaire d'installer le plugin &lt;a href=&quot;https://launchpad.net/bzr.webdav&quot; hreflang=&quot;en&quot;&gt;bzr.webdav&lt;/a&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ sudo aptitude install bzr-webdav
&lt;/pre&gt;


&lt;p&gt;ou si le paquet n'existe pas pour votre distribution&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ bzr co lp:bzr.webdav
$ cd bzr.webdav
$ python setup.py build
...
$ cp -R cp -R build/lib/bzrlib/plugins/webdav/ ~/.bazaar/plugins/
&lt;/pre&gt;


&lt;p&gt;Pour s'assurer que le plugin est bien détecté&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ bzr plugins
...
webdav 1.12.1
    An http transport, using webdav to allow pushing.
...
&lt;/pre&gt;


&lt;p&gt;À noter que ce dernier ne fonctionne que pour &lt;em&gt;bzr &amp;gt;= 1.12&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;Une fois le plugin installé, il devrait être possible d'utiliser le dépôt de manière assez transparente&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ bzr checkout https+webdav://&amp;lt;username&amp;gt;:&amp;lt;password&amp;gt;@dev.fabienpoulard.info/bzr/miage2010/dev/
...
$ cd  dev/
$ touch README
$ bzr status
unknown:
  README
$ bzr add
adding README
$ bzr commit -m &amp;quot;Test&amp;quot;
HTTPS poulard-f@dev.fabienpoulard.info, Realm: 'Authentification BZR pour les miagistes 2010' password: ...
Committing to: https+webdav://poulard-f@dev.fabienpoulard.info/bzr/miage2010/dev/
added README
Committed revision 1.
&lt;/pre&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/03/09/Utiliser-Bazaar-au-travers-de-Web-DAV#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/03/09/Utiliser-Bazaar-au-travers-de-Web-DAV#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/82</wfw:commentRss>
      </item>
    
  <item>
    <title>Utilisation du CAS Editor</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/03/04/Utilisation-du-CAS-Editor</link>
    <guid isPermaLink="false">urn:md5:483f6a88a00d05d40ab41ec60c3dfe01</guid>
    <pubDate>Sat, 06 Mar 2010 19:21:00 +0100</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Sciences &amp; Recherche</category>
        <category>cas editor</category><category>corpus</category><category>uima</category>    
    <description>&lt;p&gt;Il y a quelques temps j'avais écrit une documentation en interne dans &lt;a href=&quot;http://www.lina.univ-nantes.fr/&quot; hreflang=&quot;fr&quot;&gt;mon laboratoire&lt;/a&gt; sur l'utilisation du &lt;a href=&quot;http://incubator.apache.org/uima/downloads/releaseDocs/2.3.0-incubating/docs/html/tools/tools.html#ugr.tools.ce&quot; hreflang=&quot;en&quot;&gt;''CAS Editor''&lt;/a&gt;. À l'époque c'était assez éprouvant car ce dernier se présentait sous la forme d'une &lt;a href=&quot;http://wiki.eclipse.org/index.php/Rich_Client_Platform&quot; hreflang=&quot;en&quot;&gt;application RCP Eclipse&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Depuis la &lt;a href=&quot;http://www.apache.org/dist/incubator/uima/RELEASE_NOTES-uimaj-2.3.0-incubating.html&quot; hreflang=&quot;en&quot;&gt;version 2.3.0&lt;/a&gt;, le &lt;em&gt;CAS Editor&lt;/em&gt; a été intégré sous la forme d'un plugin Eclipse. L'occasion de remettre la doc au goût du jour et de la partager avec le reste du monde.&lt;/p&gt;    &lt;h2&gt;Avant propos&lt;/h2&gt;


&lt;p&gt;Avant toute chose il est nécessaire d'installer les plugins Eclipse de UIMA. Pour ce faire, il faut ajouter le dépôt Eclipse&amp;nbsp;: &lt;em&gt;&lt;a href=&quot;http://www.apache.org/dist/incubator/uima/eclipse-update-site/&quot;&gt;http://www.apache.org/dist/incubator/uima/eclipse-update-site/&lt;/a&gt;&lt;/em&gt; dans l'outil de gestion des plugins. Ensuite il suffit de rechercher UIMA et d'installer tous les plugins associés.&lt;/p&gt;


&lt;p&gt;À noter que les personnes ayant installé les plugins des versions antérieures doivent simplement faire une mise-à-jour afin de faire apparaître le plugin &lt;em&gt;CAS Editor&lt;/em&gt; qui n'était pas présent auparavant.&lt;/p&gt;


&lt;p&gt;Un petit redémarrage d'Eclipse et vous devriez être paré pour la suite...&lt;/p&gt;


&lt;h2&gt;Initialiser un projet&lt;/h2&gt;


&lt;p&gt;Le fonctionnement du CAS Editor est lié à&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;une vue CAS Editor&lt;/li&gt;
&lt;li&gt;un projet CAS Editor&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ceci est spécifique à la version 2.3 d'UIMA et devrait évoluer dans les prochaines versions.&lt;/p&gt;


&lt;p&gt;La vidéo ci-dessous illustre les étapes nécessaires à l'initialisation d'un projet et l'importation d'un corpus&amp;nbsp;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Créer un projet CAS Editor&lt;/li&gt;
&lt;li&gt;Passe en vue CAS Editor afin d'accéder aux fonctionnalités spécifiques&lt;/li&gt;
&lt;li&gt;Créer un répertoire corpus&lt;/li&gt;
&lt;li&gt;Importer dans ce répertoire corpus des fichiers textes afin de les transformer en CAS&lt;/li&gt;
&lt;li&gt;Ouvrir et visualiser le contenu des fichiers (CAS) du corpus&lt;/li&gt;
&lt;/ol&gt;
&lt;object width=&quot;480&quot; height=&quot;365&quot;&gt;
  &lt;param name=&quot;movie&quot; value=&quot;http://www.dailymotion.com/swf/xch81h&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;
  &lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
  &lt;embed src=&quot;http://www.dailymotion.com/swf/xch81h&quot; width=&quot;480&quot; height=&quot;365&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot;&gt;&lt;/embed&gt;
&lt;/object&gt;



&lt;h2&gt;Ajouter des annotations manuellement&lt;/h2&gt;


&lt;p&gt;Il n'est possible d'ajouter des annotations que si le type d'annotation à ajouter est présent dans le &lt;em&gt;Type System&lt;/em&gt;. Si toutefois vous ajoutez des types d'annotation à un &lt;em&gt;Type System&lt;/em&gt; qui est déjà utilisé par le projet CAS Editor, les nouveaux types ne vont pas apparaître. Il est nécessaire de fermer puis réouvrir le projet.&lt;/p&gt;


&lt;p&gt;Il y a deux façons d'ajouter une annotation dans un CAS, l'une permet d'ajouter la même annotation par un simple appuie sur &lt;em&gt;Entrée&lt;/em&gt;&amp;nbsp;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Sélectionner le texte&lt;/li&gt;
&lt;li&gt;Sélectionner le type d'annotation dans le Feature View&lt;/li&gt;
&lt;li&gt;Appuyer sur Entrée&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;l'autre permet de choisir le type de chaque nouvelle annotation rajoutée&amp;nbsp;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Sélectionner le texte&lt;/li&gt;
&lt;li&gt;Appuyer sur shift + entrée&lt;/li&gt;
&lt;li&gt;Choisir l'annotation à ajouter&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;La vidéo ci-dessous illustre ces deux méthodes&amp;nbsp;:&lt;/p&gt;

&lt;object width=&quot;480&quot; height=&quot;365&quot;&gt;
  &lt;param name=&quot;movie&quot; value=&quot;http://www.dailymotion.com/swf/xch7wr&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;
  &lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
  &lt;embed src=&quot;http://www.dailymotion.com/swf/xch7wr&quot; width=&quot;480&quot; height=&quot;365&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot;&gt;&lt;/embed&gt;
&lt;/object&gt;



&lt;h2&gt;Utiliser un AE pour ajouter des annotations&lt;/h2&gt;


&lt;p&gt;Il est tout à fait possible d'utiliser directement un &lt;em&gt;Analysis Engine&lt;/em&gt; directement dans le CAS Editor afin d'ajouter des annotations aux CAS. La procédure est toutefois un peu contraignante et surtout peu intuitive. Je vais décrire l'approche qui consiste à utiliser un composant empaqueté dans un PEAR.&lt;/p&gt;


&lt;h3&gt;Construction et installation du PEAR&lt;/h3&gt;


&lt;p&gt;Pour l'exemple je vais prendre le WhitespaceTokenizer, ce dernier a deux avantages pour ce tutoriel&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Il est simple d'utilisation (pas de paramètres) et n'a pas de dépendances sur d'autres composants&lt;/li&gt;
&lt;li&gt;Il fait parti officiellement d'UIMA et distribué sur le site&amp;nbsp;: &lt;a href=&quot;http://incubator.apache.org/uima/downloads.cgi#Latest%20Official%20Releases&quot; hreflang=&quot;en&quot;&gt;UIMA Annotator Addons &amp;amp; Simple Server &amp;amp; Pear packaging tools&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Il nous faut la &lt;a href=&quot;http://mirror.mkhelif.fr/apache/incubator/uima/source/uimaj-annotator-addons-2.3.0-incubating/uimaj-annotator-addons-2.3.0-incubating-src.tar.gz&quot;&gt;version source&lt;/a&gt; du paquet UIMA Annotator Addons &amp;amp; Simple Server &amp;amp; Pear packaging tools. Une fois téléchargée, décompressez là quelque part et placez-vous dans le répertoire &lt;em&gt;uimaj-annotator-addons-2.3.0-incubating/WhitespaceTokenizer/&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;Il nous faut modifier un peu le &lt;em&gt;pom.xml&lt;/em&gt; afin d'y ajouter les dépôts qui sont normalement déclarés dans le pom parent&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;xml&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;repositories&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;repository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;apache&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Apache UIMA&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;layout&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;default&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/layout&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;http://people.apache.org/repo/m2-incubating-repository/&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/repository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/repositories&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;pluginRepositories&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;pluginRepository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;apache&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Apache UIMA&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;http://people.apache.org/repo/m2-incubating-repository/&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;layout&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;default&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/layout&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/pluginRepository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/pluginRepositories&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  ...&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Il est alors possible de créer le PEAR avec maven en lançant dans le répertoire du WhitespaceTokenizer&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ mvn package
&lt;/pre&gt;


&lt;p&gt;Le pear est alors créé dans le répertoire &lt;em&gt;target/&lt;/em&gt; sous le nom &lt;em&gt;WhitespaceTokenizer.pear&lt;/em&gt;. Il faut l'installer à l'aide du &lt;a href=&quot;http://incubator.apache.org/uima/downloads/releaseDocs/2.3.0-incubating/docs/html/tools/tools.html#ugr.tools.pear.installer&quot; hreflang=&quot;en&quot;&gt;PearInstaller&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Une fois le PEAR installé, il faut créer un répertoire &lt;em&gt;processing&lt;/em&gt; dans le projet du CAS Editor, y importer le descripteur PEAR, l'intégrer à un composant Agregate. On peut alors le faire tourner sur une partie du corpus.&lt;/p&gt;


&lt;p&gt;La vidéo ci-dessous présente ces dernières phases&amp;nbsp;:&lt;/p&gt;

&lt;object width=&quot;480&quot; height=&quot;365&quot;&gt;
  &lt;param name=&quot;movie&quot; value=&quot;http://www.dailymotion.com/swf/xch9qq&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;
  &lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
  &lt;embed src=&quot;http://www.dailymotion.com/swf/xch9qq&quot; width=&quot;480&quot; height=&quot;365&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot;&gt;&lt;/embed&gt;&lt;/object&gt;



&lt;h2&gt;Visualiser et modifier les annotations&lt;/h2&gt;


&lt;p&gt;Le but du CAS Editor est tout de même de pouvoir visualiser et manipuler les annotations, ce qui se fait dans l'éditeur.&lt;/p&gt;


&lt;p&gt;La visualisation des annotations est configurable par le menu contextuel &lt;em&gt;Show annotations&lt;/em&gt; où l'on sélectionne les annotations à afficher. Le mode de mise en valeur de ces dernières se configure dans les propriétés du projet.&lt;/p&gt;


&lt;p&gt;Le parcours des annotations s'opère de plusieurs manières&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Par le menu contextuel, &lt;em&gt;Mode&lt;/em&gt; permet de sélectionner la façon dont on parcours/sélectionne les annotations&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;L'onglet &lt;em&gt;Feature Structure View&lt;/em&gt; permet de sélectionner les types d'annotation à faire apparaître dans l'onglet &lt;em&gt;Outline&lt;/em&gt;, il alors possible dans ce dernier de supprimer des annotations (croix rouge)&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Les onglets &lt;em&gt;Edit View&lt;/em&gt; permettent quant à eux de modifier les valeurs des champs de l'annotation sélectionnée.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;La vidéo ci-dessous illustre ces différentes manipulations&amp;nbsp;:&lt;/p&gt;

&lt;object width=&quot;480&quot; height=&quot;365&quot;&gt;
  &lt;param name=&quot;movie&quot; value=&quot;http://www.dailymotion.com/swf/xchcl9&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;
  &lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
  &lt;embed src=&quot;http://www.dailymotion.com/swf/xchcl9&quot; width=&quot;480&quot; height=&quot;365&quot; allowfullscreen=&quot;true&quot; allowscriptaccess=&quot;always&quot;&gt;&lt;/embed&gt;&lt;/object&gt;
</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/03/04/Utilisation-du-CAS-Editor#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/03/04/Utilisation-du-CAS-Editor#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/81</wfw:commentRss>
      </item>
    
  <item>
    <title>Release du collection reader pour Wikipedia v.0.4</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/03/04/Release-du-collection-reader-pour-Wikipedia-v.0.4</link>
    <guid isPermaLink="false">urn:md5:00ae4a31fc03cd3dcf109c0e6381b560</guid>
    <pubDate>Thu, 04 Mar 2010 13:39:00 +0100</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Sciences &amp; Recherche</category>
        <category>release</category><category>uima</category><category>wikipedia</category>    
    <description>&lt;p&gt;Wikipedia est une incroyable source d’information, de données et plus généralement d’actes langagiers (utilisation du langage). C'est une ressource sans équivalent pour les chercheurs en traitement automatique des langues (TAL).&lt;/p&gt;


&lt;p&gt;Le &lt;em&gt;MediaWiki UIMA Loader&lt;/em&gt; est un composant UIMA, de type collection reader, permettant de tirer parti de Wikipédia pour la construction de corpus. La version &lt;em&gt;0.4&lt;/em&gt; est la première release officiellement annoncée du composant.&lt;/p&gt;    &lt;p&gt;Pour les impatients&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.uima-fr.org/download/mediawiki-uima-loader-0.4.1.jar&quot;&gt;Le jar du composant&lt;/a&gt; (et ses dépendances&amp;nbsp;: &lt;a href=&quot;http://www.uima-fr.org/m2-repo/org/wikimedia/mwdumper/1.16/mwdumper-1.16.jar&quot;&gt;mwdumper&lt;/a&gt; et &lt;a href=&quot;http://www.uima-fr.org/m2-repo/org/wikimodel/org.wikimodel.wem/2.0.7-SNAPSHOT/org.wikimodel.wem-2.0.7-SNAPSHOT.jar&quot;&gt;wikimodel.wem&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.uima-fr.org/download/mediawiki-uima-loader-0.4.1.tar.gz&quot;&gt;Les sources du composant&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Présentation du composant&lt;/h2&gt;


&lt;p&gt;Le composant &lt;em&gt;MediaWiki UIMA Loader&lt;/em&gt; est un &lt;a href=&quot;http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/overview_and_setup/overview_and_setup.html#ugr.ovv.conceptual.applicaiton_building_and_collection_processing&quot; hreflang=&quot;en&quot;&gt;collection reader&lt;/a&gt; permettant de charger des données issues d'un MediaWiki, notamment &lt;a href=&quot;http://fr.wikipedia.org&quot; hreflang=&quot;fr&quot;&gt;Wikipédia&lt;/a&gt; et &lt;a href=&quot;http://fr.wikinews.org&quot; hreflang=&quot;fr&quot;&gt;ses&lt;/a&gt; &lt;a href=&quot;http://fr.wikiversity.org&quot; hreflang=&quot;fr&quot;&gt;projets&lt;/a&gt; &lt;a href=&quot;http://fr.wiktionary.org&quot; hreflang=&quot;fr&quot;&gt;dérivés&lt;/a&gt; &lt;a href=&quot;http://wikimediafoundation.org/wiki/Our_projects&quot; hreflang=&quot;en&quot;&gt;...&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Le composant est distribué &lt;a href=&quot;http://www.apache.org/licenses/LICENSE-2.0.txt&quot; hreflang=&quot;en&quot;&gt;sous licence Apache 2&lt;/a&gt;. Vous pouvez donc l'utiliser dans le cadre d'un travail académique ou commercial. Dans les deux cas, si vous trouvez le composant utile, n'hésitez pas à me dire ce que vous en pensez, si vous souhaitez de nouvelles fonctionnalités ou si vous rencontrez des bugs.&lt;/p&gt;


&lt;p&gt;Contrairement à plusieurs projets existant, le composant n'attaque pas directement les sites Wikipedia. Il ne nécessite pas non plus de créer un miroir local de la base de données MediaWiki. Il travaille directement à partir des &lt;a href=&quot;http://download.wikimedia.org/backup-index.html&quot; hreflang=&quot;en&quot;&gt;dumps XML&lt;/a&gt;, ce qui présente les avantages suivant&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pas d'accès répétitifs aux serveurs des projets MediaWiki, préservant la bande passante et le temps de calcul de ces derniers&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Pas besoin de déployer un serveur de base de données en local et d'y importer les données de dump (si ça vous amuse, vous pouvez toujours suivre &lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2009/11/18/Ins%C3%A9rer-plusieurs-copies-locales-de-Wikipedia-dans-une-base-PostgreSQL&quot; hreflang=&quot;en&quot;&gt;ce tutoriel&lt;/a&gt;)&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Limiter l'espace disque disponible pour stocker les informations en utilisant directement la version compressée des dumps&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Limiter la latence dans l'accès aux données provoquées par les requêtes réseau ou bien le serveur SQL.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Les fonctionnalités de cette version 0.4 sont les suivantes&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Chargement à partir d'un dump XML compressé ou non&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Nombreuses options de filtrage (voir plus bas) concernant les pages et révisions à charger dans la chaîne de traitement&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Interprétation de la syntaxe wiki et annotation des &lt;em&gt;Titres&lt;/em&gt;, &lt;em&gt;Sections&lt;/em&gt;, &lt;em&gt;Paragraphes&lt;/em&gt; et &lt;em&gt;Liens&lt;/em&gt; (cf. &lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/14/UIMA-Wikip%C3%A9dia-%284%29-%3A-Analyse-syntaxique-du-langage-Wiki&quot; hreflang=&quot;en&quot;&gt;ce billet&lt;/a&gt; pour plus d'informations).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Installation&lt;/h2&gt;


&lt;p&gt;Avant d'installer et d'utiliser le composant, il est nécessaire d'avoir un environnement UIMA installé. Si ce n'est pas le cas, se référer à &lt;a href=&quot;http://incubator.apache.org/uima/downloads/releaseDocs/2.3.0-incubating/docs/pdf/overview_and_setup.pdf&quot;&gt;ce tutoriel&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Le plus simple est de récupérer &lt;a href=&quot;http://www.uima-fr.org/download/mediawiki-uima-loader-0.4.1.jar&quot;&gt;le jar du composant&lt;/a&gt; dans &lt;a href=&quot;http://www.uima-fr.org/download/&quot;&gt;l'espace de téléchargement de uima-fr&lt;/a&gt;, ainsi que les dépendances&amp;nbsp;: &lt;a href=&quot;http://www.uima-fr.org/m2-repo/org/wikimedia/mwdumper/1.16/mwdumper-1.16.jar&quot;&gt;mwdumper&lt;/a&gt; et &lt;a href=&quot;http://www.uima-fr.org/m2-repo/org/wikimodel/org.wikimodel.wem/2.0.7-SNAPSHOT/org.wikimodel.wem-2.0.7-SNAPSHOT.jar&quot;&gt;wikimodel.wem&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Si vous souhaitez reconstruire le jar vous mêmes, il vous faut télécharger &lt;a href=&quot;http://www.uima-fr.org/download/mediawiki-uima-loader-0.4.1.tar.gz&quot;&gt;les sources du composant&lt;/a&gt;, toujours dans &lt;a href=&quot;http://www.uima-fr.org/download/&quot;&gt;l'espace de téléchargement de uima-fr&lt;/a&gt;,et les compiler à l'aide de maven&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ tar -xzvf mediawiki-uima-loader-0.4.1.tar.gz
...
$ cd mediawiki-uima-loader-0.4.1
$ mvn package
...
&lt;/pre&gt;


&lt;p&gt;Le jar devrait être créé dans le répertoire &lt;em&gt;target/&lt;/em&gt;, les dépendances quant à elles auront été téléchargées dans votre dépôt maven local.&lt;/p&gt;


&lt;h2&gt;Utilisation&lt;/h2&gt;


&lt;p&gt;Vous pouvez utiliser le composant dans n'importe quelle chaîne de traitement UIMA, de la même façon que vous utilisez un composant classique de type collection reader. La démarche ci-dessous concerne l'utilisation de l'outil &lt;em&gt;cpeGui&lt;/em&gt;, mais elle devrait être similaire pour les autres outils du même type.&lt;/p&gt;


&lt;p&gt;Le &lt;em&gt;cpeGui&lt;/em&gt; n'est pas capable en l'état de charger un descripteur xml depuis un jar. Avant tout, il est donc nécessaire d'extraire le descripteur du composant du jar afin de le rendre accessible. Si vous avez compilé le composant vous même, le descripteur est présent dans le répertoire &lt;em&gt;desc&lt;/em&gt;. Sinon, il suffit de l'extraire du jar&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ jar -x wikipedia-cr.xml -f mediawiki-uima-loader-0.4.1.jar
&lt;/pre&gt;


&lt;p&gt;Il est nécessaire de rajouter le jar du composant et de ses dépendances dans le UIMA_CLASSPATH, avant de lancer le &lt;em&gt;cpeGui&lt;/em&gt; en ligne de commande. Pour l'exemple, nous considérerons que le jar du composant est dans le répertoire courant et que les dépendances sont dans le dépôt maven local&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ export UIMA_CLASSPATH=$UIMA_CLASSPATH:~/.m2/repository/org/wikimedia/mwdumper/1.16/mwdumper-1.16.jar:~/.m2/repository/org/wikimodel/org.wikimodel.wem/2.0.7-SNAPSHOT/org.wikimodel.wem-2.0.7-SNAPSHOT.jar:mediawiki-uima-loader-0.4.1.jar
$ cpeGui
&lt;/pre&gt;


&lt;p&gt;&lt;a href=&quot;http://www.fabienpoulard.info/public/UIMA/Wikipedia/cpegui-uima.jpg&quot;&gt;&lt;img src=&quot;http://www.fabienpoulard.info/public/UIMA/Wikipedia/.cpegui-uima_m.jpg&quot; alt=&quot;Interface du cpeGui&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Interface du cpeGui, mar. 2010&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Dans la partie de l'interface dédiée au &lt;em&gt;Collection Reader&lt;/em&gt;, cliquez sur &lt;em&gt;Browse&lt;/em&gt; et allez sélectionner le descripteur du composant que nous avons extrait du jar (&lt;em&gt;wikipedia-cr.xml&lt;/em&gt;). L'interface se modifie afin d'offrir les champs de paramétrage du composant.&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://www.fabienpoulard.info/public/UIMA/Wikipedia/cpegui-uima-wikipedia-cr.jpg&quot;&gt;&lt;img src=&quot;http://www.fabienpoulard.info/public/UIMA/Wikipedia/.cpegui-uima-wikipedia-cr_m.jpg&quot; alt=&quot;Interface de configuration du Mediawiki UIMA Loader&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Interface de configuration du Mediawiki UIMA Loader, mar. 2010&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Le seul paramètre obligatoire est le champs &lt;strong&gt;Input Xml Dump&lt;/strong&gt;. Vous devez renseigner dans ce dernier le chemin menant au dump XML de Wikipedia (ou tout autre dump MediaWiki) que vous souhaitez charger. Par exemple&amp;nbsp;: &lt;em&gt;~/frwiki-20100111-pages-meta-history.xml.bz2&lt;/em&gt;. Le composant est capable de lire un dump, qu'il soit compressé ou non.&lt;/p&gt;


&lt;p&gt;Les autres paramètres concernent le filtrage à mettre en place lors du chargement des données&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Latest Revision Only&lt;/strong&gt;, si vous cochez cette case seules la dernière révision disponible pour chaque article sera chargée, sinon toutes les révisions (présentes dans le dump) seront chargées&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ignore Talks&lt;/strong&gt;, si vous cochez cette case, les pages de type discussion seront ignorées, sinon elles seront également chargées&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Config Namespaces Filter&lt;/strong&gt;, ce champs permet de spécifier les espaces de nom à considérer lors du chargement. S'il est laissé vide, tous les espaces de nom sont chargés. Pour wikipedia les espaces de nom disponibles sont&amp;nbsp;:
&lt;ul&gt;
&lt;li&gt;-2&amp;nbsp;: ressources de type média&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;-1&amp;nbsp;: pages spéciales&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;0&amp;nbsp;: espace de nom principal où l'on trouve les articles de l'encyclopédie&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;1&amp;nbsp;: discussions à propos des articles&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;2&amp;nbsp;: pages des utilisateurs&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;3&amp;nbsp;: discussion à propos des utilisateurs&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;4&amp;nbsp;: espace Wikipédia (le projet)&lt;/li&gt;
&lt;li&gt;5&amp;nbsp;: espace de discussion autour du projet Wikipédia&lt;/li&gt;
&lt;li&gt;6&amp;nbsp;: fichiers&lt;/li&gt;
&lt;li&gt;7&amp;nbsp;: discussion à propos des fichiers&lt;/li&gt;
&lt;li&gt;8&amp;nbsp;: espace MédiaWiki (le logiciel)&lt;/li&gt;
&lt;li&gt;9&amp;nbsp;: discussion à propos de MédiaWiki&lt;/li&gt;
&lt;li&gt;10&amp;nbsp;: modèles&lt;/li&gt;
&lt;li&gt;11&amp;nbsp;: discussion à propos des modèles&lt;/li&gt;
&lt;li&gt;12&amp;nbsp;: aide&lt;/li&gt;
&lt;li&gt;13&amp;nbsp;: discussion à propos de l'aide&lt;/li&gt;
&lt;li&gt;14&amp;nbsp;: catégories&lt;/li&gt;
&lt;li&gt;15&amp;nbsp;: discussion à propos des catégories&lt;/li&gt;
&lt;li&gt;100&amp;nbsp;: portail&lt;/li&gt;
&lt;li&gt;101&amp;nbsp;: discussion à propos du portail&lt;/li&gt;
&lt;li&gt;102&amp;nbsp;: projets&lt;/li&gt;
&lt;li&gt;103&amp;nbsp;: discussion autour des projets&lt;/li&gt;
&lt;li&gt;104&amp;nbsp;: références&lt;/li&gt;
&lt;li&gt;105&amp;nbsp;: discussion autour des références&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Par exemple pour prendre en considération uniquement toutes les pages de discussion&amp;nbsp;: &lt;em&gt;1,3,5,7,9,11,13,15,101,103,105&lt;/em&gt;, ou bien pour prendre en compte tous les espaces de nom excepté celui des catégories&amp;nbsp;: &lt;em&gt;!14&lt;/em&gt;&amp;nbsp;;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Config Title Match&lt;/strong&gt;, ce champs permet à l'aide d'une expression rationnelle de filtrer les pages dont le titre valide l'expression rationnelle. Par exemple&amp;nbsp;: &lt;em&gt;A.*&lt;/em&gt; pour toutes les pages commençant dont le titre commence par &lt;em&gt;A&lt;/em&gt;&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Config List Filter&lt;/strong&gt; et &lt;strong&gt;Config Exact List Filter&lt;/strong&gt;, ces champs permette d'indiquer en paramètre le chemin d'un fichier contenant un nom de page par ligne. Seules les pages précisées dans ce fichier seront chargées. Si c'est le paramétrage &lt;em&gt;Exact&lt;/em&gt; qui est employé, le titre doit correspondre exactement, autrement le filtre vérifie s'il correspond au titre de l'article ou éventuellement de sa page de discussion&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Config Revision List Filter&lt;/strong&gt;, ce champs permet de renseigner le chemin d'un fichier contenant en paramètre les numéros de révision à charger (une révision par ligne)&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Config Before Timestamp Filter&lt;/strong&gt; et &lt;strong&gt;Config After Timestamp Filter&lt;/strong&gt;, ces champs permettent de délimiter temporellement les données à importer en indiquant des dates limites de début et de fin au format &lt;em&gt;yyyy-MM-dd'T'HH:mm:ss'Z&lt;/em&gt;'.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Une fois le composant paramétré, il suffit de renseigner les autres composants de la chaîne comme vous le faites habituellement et de lancer l'exécution.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Attention&lt;/strong&gt;, si vous exportez le contenu traité par le composant, à l'aide du composant &lt;em&gt;XmiWriter&lt;/em&gt; par exemple, à partir d'un dump compressé, prenez en compte que le volume de données risque d'être 20 à 100 fois supérieures à la taille originale du dump. Ainsi, il faut compter une vingtaine de Go minimum pour la version française de Wikipédia en ne considérant que les dernières révisions des articles.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/03/04/Release-du-collection-reader-pour-Wikipedia-v.0.4#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/03/04/Release-du-collection-reader-pour-Wikipedia-v.0.4#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/80</wfw:commentRss>
      </item>
    
  <item>
    <title>UIMA &amp; Wikipédia (5) : Gestion du projet avec Maven</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/02/21/UIMA-Wikip%C3%A9dia-%285%29-%3A-Gestion-du-projet-avec-Maven</link>
    <guid isPermaLink="false">urn:md5:52135ef595bb9ad33ed3e4cefda29781</guid>
    <pubDate>Sun, 21 Feb 2010 17:56:00 +0100</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Sciences &amp; Recherche</category>
        <category>java</category><category>maven</category><category>uima</category><category>wikipedia</category>    
    <description>&lt;p&gt;La création de composants UIMA permettant d'accéder et tirer parti de Wikipédia offrirait de nouvelles perspectives au traitement des langues en offrant un accès aisé à cette formidable ressource que représente l'encyclopédie libre. Je compte m'atteler à la création de tels composants et vais tâcher de publier plusieurs billets décrivant ma démarche en cours.&lt;/p&gt;


&lt;p&gt;Voici le cinquième billet, plus orienté technique de développement, qui discute de la gestion du projet avec &lt;a href=&quot;http://maven.apache.org&quot;&gt;Maven&lt;/a&gt;, permettant notamment de gérer automatiquement les dépendances à &lt;a href=&quot;http://www.mediawiki.org/wiki/MWDumper&quot;&gt;MWDumper&lt;/a&gt; et à &lt;a href=&quot;http://code.google.com/p/wikimodel/&quot;&gt;Wikimodel&lt;/a&gt;.&lt;/p&gt;    &lt;h2&gt;Qu'est-ce que Maven&amp;nbsp;?&lt;/h2&gt;


&lt;p&gt;&lt;a href=&quot;http://maven.apache.org&quot; hreflang=&quot;en&quot;&gt;Maven&lt;/a&gt; est une sorte de super-gestionnaire de projet qui peut se charger d'à peu près tout&amp;nbsp;: dépendances, compilation, packaging, lancement des tests unitaires, ... L'outil est disponible sur la plupart des distribution, pour ma part sous Ubuntu&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ sudo aptitude install maven2
&lt;/pre&gt;


&lt;p&gt;L'objectif de ce billet est d'expliquer comment, à l'aide de &lt;a href=&quot;http://jerome.rocheteau.free.fr/&quot; hreflang=&quot;fr&quot;&gt;notre génial ingénieur de recherche&lt;/a&gt;, j'ai pu utilisé maven pour gérer la construction du collection reader pour Wikipedia.&lt;/p&gt;


&lt;h2&gt;Récupérer les dépendances&lt;/h2&gt;


&lt;p&gt;La première complication lorsque l'on souhaite compiler le collection reader ce sont les dépendances, il y en a trois&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;UIMA, mais ceux qui veulent utiliser le composant doivent d'ores et déjà avoir réglé ce problème&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;le projet &lt;a href=&quot;http://www.mediawiki.org/wiki/MWDumper&quot; hreflang=&quot;en&quot;&gt;mwdumper&lt;/a&gt; de &lt;a href=&quot;http://www.mediawiki.org/&quot; hreflang=&quot;en&quot;&gt;MediaWiki&lt;/a&gt;&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;le sous-projet &lt;a href=&quot;http://code.google.com/p/wikimodel/source/browse/#svn/trunk/org.wikimodel.wem&quot;&gt;org.wikimodel.wem&lt;/a&gt; de &lt;a href=&quot;http://code.google.com/p/wikimodel/&quot; hreflang=&quot;en&quot;&gt;WikiModel&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Par chance tous ces projets sont déjà gérés par maven ce qui va fortement nous faciliter la tâche. Les étapes à suivre sont les suivantes&amp;nbsp;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Obtenir une version des sources de chacun des projets&lt;/li&gt;
&lt;li&gt;Les compiler avec maven&lt;/li&gt;
&lt;li&gt;Les installer dans le dépôt local de maven&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ainsi pour mwdumper&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/mwdumper
...
$ cd mwdumper
$ mvn compile
...
$ mvn install
...
&lt;/pre&gt;


&lt;p&gt;Une fois ces étapes terminées, un nouveau dossier doit apparaître dans votre dépôt local&amp;nbsp;: &lt;em&gt;~/.m2/repository/org/wikimedia/mwdumper/&lt;/em&gt;&amp;nbsp;; il doit contenir un dossier correspondant à la version compilée (1.16 pour moi) et dans ce dossier les fichiers suivants&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;mwdumper-1.16.jar&lt;/li&gt;
&lt;li&gt;mwdumper-1.16.pom&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Il faut procéder de la même manière pour WikiModel&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ svn co http://wikimodel.googlecode.com/svn/trunk/org.wikimodel.wem
...
$ cd org.wikimodel.wem
$ mvn compile
...
$ mvn install
...
&lt;/pre&gt;


&lt;p&gt;Vous devriez de la même manière voir apparaître dans votre dépôt local&amp;nbsp;: &lt;em&gt;~/.m2/repository/org/wikimodel/org.wikimodel.wem/&lt;/em&gt;&amp;nbsp;; il doit contenir une structure similaire.&lt;/p&gt;


&lt;p&gt;Ces étapes sont nécessaires pour la suite car elles placent les dépendances dans le dépôt local de maven, là où il ira les chercher lors de la compilation.&lt;/p&gt;


&lt;h2&gt;Écriture du pom.xml&lt;/h2&gt;


&lt;p&gt;Revenons maintenant au composant UIMA. L'intelligence de Maven se configure dans un fichier à la racine du projet et nommé &lt;em&gt;pom.xml&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;Dans un premier temps, il faut définir le projet en lui donnant&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Un identifiant de groupe (dans le cas où le projet appartiendrait à un groupe de projets)&amp;nbsp;: &lt;em&gt;groupId&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Un identifiant d'artefact, c-à-d de ce que le projet va produire&amp;nbsp;: &lt;em&gt;artifactId&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Spécifier une version&amp;nbsp;: &lt;em&gt;version&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Donner un nom et une description&lt;/li&gt;
&lt;li&gt;Renseigner les informations concernant les licences&lt;/li&gt;
&lt;li&gt;Spécifier le type de packaging que l'on souhaite obtenir&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;xml&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color: #000066;&quot;&gt;xmlns&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://maven.apache.org/POM/4.0.0&amp;quot;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color: #000066;&quot;&gt;xmlns:xsi&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color: #000066;&quot;&gt;xsi:schemaLocation&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&amp;quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;modelVersion&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;4.0.0&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/modelVersion&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;uima.wikipedia&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;uima-mediawiki-loader&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;0.4&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;packaging&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;jar&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/packaging&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;MediaWiki UIMA Loader&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;description&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;This is a UIMA Collection Reader for the MediaWiki dumps (Wikipedia &lt;span style=&quot;color: #ddbb00;&quot;&gt;&amp;amp;amp;&lt;/span&gt; co).&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/description&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;licenses&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;license&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Apache 2&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;http://www.apache.org/licenses/LICENSE-2.0.txt&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/license&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/licenses&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  ...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/project&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Dans un second temps, nous définissons les dépendances nécessaires à la construction de notre composant. Comme nous l'avons vu précédemment, il y en a plusieurs&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;UIMA, et plus précisément &lt;em&gt;uimaj-core&lt;/em&gt; et &lt;em&gt;uimaj-document-annotation&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;WikiModel, et plus précisément &lt;em&gt;org.wikimodel.wem&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;MWdumper&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Les dépendances se déclarent entre les tags &lt;em&gt;&amp;lt;dependencies&amp;gt;&lt;/em&gt;, en indiquant notamment la version nécessaire.&lt;/p&gt;

&lt;pre class=&quot;xml&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;dependencies&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- Required to generate the Java classes --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;org.apache.uima&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;uimaj-core&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;2.3.0-incubating&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;scope&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;compile&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/scope&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- DocumentAnnotation UIMA Type --&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;org.apache.uima&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;uimaj-document-annotation&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;2.3.0-incubating&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;scope&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;compile&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/scope&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- WikiModel --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;       &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;org.wikimodel&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;       &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;org.wikimodel.wem&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;       &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;2.0.7-SNAPSHOT&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- WikiMedia Dumper --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;org.wikimedia&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;mwdumper&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;1.16&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/dependency&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/dependencies&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  ...&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Comme vous l'avez certainement remarqué, on a précisé que le projet dépendait d'UIMA, mais contrairement aux dépendances sur MWDumper et WikiModel, nous n'avons pas installé ces dernières dans le dépôt maven local. En fait Maven va être capable d'aller chercher tout seul ces dépendances grâce au dépôt maven mis en ligne par Apache UIMA. Il suffit de préciser l'existence de ce dépôt&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;xml&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;repositories&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- Apache UIMA repository --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;repository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;apache&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Apache&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;http://people.apache.org/repo/m2-incubating-repository&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/repository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/repositories&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  ...&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Finalement, on précise le processus de construction du composant entre les tags &lt;em&gt;&amp;lt;build&amp;gt;&lt;/em&gt;. Dans nos cas cela revient tout simplement à préciser où aller chercher les sources, où placer les fichiers compilés et préciser ce qui doit être considérés comme des ressources et donc placé dans le Jar en plus des classes.&lt;/p&gt;


&lt;p&gt;On utilisera de plus le plugin &lt;em&gt;maven-compiler-plugin&lt;/em&gt; afin de préciser la version de Java que l'on souhaite pour la compilation.&lt;/p&gt;

&lt;pre class=&quot;xml&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;build&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;plugins&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- Java Compiler --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;plugin&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;org.apache.maven.plugins&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;maven-compiler-plugin&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;2.0.2&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;configuration&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;          &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;source&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;1.5&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/source&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;          &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;1.5&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/configuration&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/plugin&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/plugins&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;sourceDirectory&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;src&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/sourceDirectory&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;outputDirectory&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;bin&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/outputDirectory&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;resources&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;resource&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;directory&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;desc&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/directory&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/resource&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/resources&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/build&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  ...&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Le &lt;em&gt;pom.xml&lt;/em&gt; est suffisant à cette étape pour permettre de lancer la compilation du projet et le packaging.&lt;/p&gt;

&lt;pre&gt;
$ mvn compile
...
&lt;/pre&gt;


&lt;p&gt;Vous devriez constater que le dossier &lt;em&gt;bin&lt;/em&gt; s'est peuplé des classes compilées.&lt;/p&gt;

&lt;pre&gt;
$ mvn package
...
&lt;/pre&gt;


&lt;p&gt;Vous devriez maintenant constater l'apparition d'un dossier &lt;em&gt;target&lt;/em&gt; dans lequel vous trouverez notamment un Jar nommé&amp;nbsp;: &lt;em&gt;uima-mediawiki-loader-0.4.jar&lt;/em&gt;. Et voilà, dans l'état il est possible d'obtenir un Jar du projet à partir des sources sans trop de problèmes. Toutefois la première étape de récupération des dépendances me paraît trop contraignantes. Il est possible, à l'instar d'Apache UIMA, de mettre en place un dépôt contenant des versions compilées des dépendances afin que maven aille directement les chercher.&lt;/p&gt;


&lt;h2&gt;Mettre en place un dépôt pour les dépendances&lt;/h2&gt;


&lt;p&gt;Un dépôt maven ce n'est ni plus ni moins qu'un système de fichiers respectant une certaine structure et accessible par http (par exemple).&lt;/p&gt;


&lt;p&gt;J'ai créé un dossier sur mon serveur que j'ai rendu &lt;a href=&quot;http://www.uima-fr.org/m2-repo/&quot;&gt;accessible&lt;/a&gt; par http à l'aide d'Apache, puis j'y ai collé l'arborescence concernant &lt;em&gt;mwdumper&lt;/em&gt; et &lt;em&gt;wikimodel&lt;/em&gt; quiu était présente dans mon dépôt local&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;~/.m2/repository//org/wikimedia/...&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;~/.m2/repository//org/wikimodel/...&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Il y a une petite nuance tout de même, lorsque le dépôt est distant, les fichiers doivent être accompagnés de leurs checksums afin de vérifier que le téléchargement s'est bien déroulé. Le plus simple pour générer ces fichiers de checksums est de réitérer l'installation dans le dépôt maven local avec une option supplémentaire&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ mvn install -DcreateChecksum=true
...
&lt;/pre&gt;


&lt;p&gt;Vous trouverez alors dans le dépôt local les fichiers en &lt;em&gt;*.md5&lt;/em&gt; et &lt;em&gt;*.sha1&lt;/em&gt; qu'il faut également transférer sur le serveur.&lt;/p&gt;


&lt;p&gt;Une fois que le dépôt distant est mis en place, il suffit de le déclarer dans le &lt;em&gt;pom.xml&lt;/em&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;xml&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;repository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;uima-fr.org&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;UIMA Fr&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;http://www.uima-fr.org/m2-repo/&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/repository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   ...&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Il est maintenant possible de compiler le composant sans avoir à récupérer les dépendances en amont. Tout se fait automatiquement et de manière transparente pour l'utilisateur... c'est assez plaisant.&lt;/p&gt;


&lt;p&gt;Comme je suis un fainéant, je trouve que ce serait cool de pouvoir déployer automatiquement mon composant sur mon dépôt, c'est tellement pratique les dépôts&amp;nbsp;!&lt;/p&gt;


&lt;h2&gt;Déployer le composant sur le dépôt&lt;/h2&gt;


&lt;p&gt;J'ai choisi de pouvoir déployer mon composant sur le dépôt par ssh, pour des questions de sécurité. Mais il est également possible de le faire &lt;a href=&quot;http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ftp.html&quot;&gt;par ftp&lt;/a&gt;. Le déploiement par ssh nécessite tout d'abord de pouvoir se connecter automatiquement au serveur par ssh à l'aide d'un échange de clé, puis il suffit de renseigner dans le &lt;em&gt;pom.xml&lt;/em&gt; l'adresse du dépôt et dans &lt;em&gt;~/.m2/settings.xml&lt;/em&gt; de préciser les modalités de connexion au dépôt.&lt;/p&gt;


&lt;h3&gt;Connexion automatique par ssh&lt;/h3&gt;


&lt;p&gt;Je ne vais pas détailler ici comment déployer un serveur ssh et faire tourner un ssh-agent en local, il y a tout un tas de tutoriels disponibles sur internet pour ça. Ce qu'il faut juste retenir, c'est que maven ne se connectera au serveur ssh si les deux conditions suivantes sont remplies&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Le serveur est connu de ssh (il est enregistré dans &lt;em&gt;.ssh/know_hosts&lt;/em&gt;)&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;La connexion peut se faire par échange de clés (pas de mot de passe).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Le plus simple pour s'assurer de tout cela est de se connecter directement manuellement au serveur&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Si le serveur est inconnu, ssh demandera s'il doit être ajouté à la liste des hôtes connus&amp;nbsp;: acceptez&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Si le serveur vous demande un mot de passe c'est qu'il ne connaît pas votre clé, il suffit de lui donner.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Copiez donc le contenu de votre clé &lt;ins&gt;publique&lt;/ins&gt; que vous trouverez dans le fichier &lt;em&gt;~/.ssh/id_dsa.pub&lt;/em&gt; ou bien &lt;em&gt;~/.ssh/id_rsa.pub&lt;/em&gt;. Elle doit ressembler à quelque chose comme ceci&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzqedhFIi8hy743U7pEvLMQvCEeAo/CxmLjF4jF2WguguN+U/4GsJrONvgoWMYXRn0zVMoHNpCEXQ+BT80ZTnv+MILu5elgFsE18bFA+7qjd454LwuZpoIoJOsCNyJKyGjy7ER5cZGN/z8G6cmSJTGauc270W7WJQELqKM3rfqPJH4FXPF9+WDP4UK/o7k54g36/3hHeBmqW++mpyEwkm0eT+GlBRlmP4NjVJACMoyYwl2S1Ep/m85aYR+95m3neHFZpUPmEyN52/Sod7ak28AHZ0M5oE/nRoUr1AAc0LzJw7BM327fAO6o7iHcfoIdo7pix2KLoteqT8tQIRQUmzxQ== grdscarabe@grdscarabe-desktop
&lt;/pre&gt;


&lt;p&gt;Attention, cette clé se trouve sur le poste client à partir duquel maven se connaîtra&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;Copiez donc cette clé dans le fichier &lt;em&gt;~/.ssh/authorized_keys&lt;/em&gt;, si ce fichier n'existe pas créez-le.  Faites bien attention à ce qu'il soit dans le répertoire personnel de l'utilisateur que maven utilisera pour se connecter (le votre très certainement).&lt;/p&gt;


&lt;p&gt;Une fois cette opération effectuée, vous devriez pouvoir vous connecter au serveur sans que ce dernier ne vous demande de mot de passe. Il se peut que si vous ayez protégé votre clé privée par un mot de passe, le ssh-agent vous le demande. Dans ce cas vous êtes de mon point de vue suffisamment au courant du problème pour ne pas lire cette section. Sinon vous êtes bien malin d'avoir mis un mot de passe :)&lt;/p&gt;


&lt;h3&gt;Déclaration du dépôt dans le &lt;em&gt;pom.xml&lt;/em&gt;&lt;/h3&gt;


&lt;p&gt;Il suffit de déclarer dans le dépôt dans le &lt;em&gt;pom.xml&lt;/em&gt;, nous l'appellerons ici &lt;em&gt;uimafr-repository&lt;/em&gt;. Il est également nécessaire de charger l'extension &lt;em&gt;wagon-ssh-external&lt;/em&gt; qui permet à maven de déployer par ssh&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;xml&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;extensions&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- Enabling the use of SSH --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;extension&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;org.apache.maven.wagon&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/groupId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;         &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;wagon-ssh-external&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/artifactId&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;         &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;1.0-beta-6&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/version&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/extension&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/extensions&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;distributionManagement&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;repository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;         &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;uimafr-repository&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;         &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;scpexe://www.uima-fr.org//home/www-data/org_uima-fr_www/m2-repo&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/url&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/repository&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/distributionManagement&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;   ...&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;h3&gt;Modalités de connexion au dépôt&lt;/h3&gt;


&lt;p&gt;Enfin, il faut localement configurer maven pour reconnaître le dépôt &lt;em&gt;uimafr-repository&lt;/em&gt;. Cette configuration se fait par le fichier &lt;em&gt;~/.m2/settings.xml&lt;/em&gt;. S'il n'existe pas, créez-le puis copiez-collez y le contenu suivant&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;xml&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;settings&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;servers&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;server&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;uimafr-repository&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/id&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;configuration&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;sshExecutable&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;ssh&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/sshExecutable&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;        &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;scpExecutable&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;scp&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/scpExecutable&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;      &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/configuration&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/server&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/servers&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/settings&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;En gros ce dernier permet de préciser quels sont les outils à utiliser pour la connexion ssh. Sous linux, nous utiliserons les outils &lt;em&gt;ssh&lt;/em&gt; pour la connexion et &lt;em&gt;scp&lt;/em&gt; pour le transfert de fichier.&lt;/p&gt;


&lt;h3&gt;Déploiement&lt;/h3&gt;


&lt;p&gt;Et voilà, maintenant pour déployer mon composant sur le dépôt, il me suffit de faire&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ mvn deploy
...
&lt;/pre&gt;


&lt;p&gt;Elle est pas belle la vie&amp;nbsp;?&lt;/p&gt;


&lt;h2&gt;Extensions possibles&lt;/h2&gt;


&lt;p&gt;Il y a bien des extensions possibles pour rendre maven encore plus pratique pour la gestion de ce projet. J'en vois notamment deux&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;La génération automatique des classes de types UIMA à partir de JCasGen&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;L'empaquetage dans le même Jar du projet et des dépendances sur MWDumper et WikiModel.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Dans le premier cas, la solution au problème doit certainement se trouver du côté du &lt;a href=&quot;http://mojo.codehaus.org/exec-maven-plugin/java-mojo.html&quot; hreflang=&quot;en&quot;&gt;''exec-maven-plugin''&lt;/a&gt;. Dans le second cas, il faudrait aller voir du côté de &lt;a href=&quot;http://maven.apache.org/plugins/maven-assembly-plugin/&quot;&gt;''maven-assembly-plugin''&lt;/a&gt;.&lt;/p&gt;


&lt;h2&gt;Nouvelle version du composant&lt;/h2&gt;


&lt;p&gt;Et je conclus ce looong billet en distribuant la nouvelle version, estampillée 0.4, du collection reader pour Wikipedia&amp;nbsp;: &lt;a href=&quot;http://www.uima-fr.org/download/mwuima-loader-0.4.jar&quot;&gt;par ici&lt;/a&gt;&amp;nbsp;! Vous trouverez les dépendances nécessaires à son fonctionnement dans &lt;a href=&quot;http://www.uima-fr.org/m2-repo/&quot;&gt;le dépôt maven de uima-fr&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Vous pouvez tester le composant à l'aide du cpeGui&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ UIMA_CLASSPATH=~/.m2/repository/uima/wikipedia/mwuima-loader/0.4/mwuima-loader-0.4.jar:~/.m2/repository/org/wikimedia/mwdumper/1.16/mwdumper-1.16.jar:~/.m2/repository/org/wikimodel/org.wikimodel.wem/2.0.7-SNAPSHOT/org.wikimodel.wem-2.0.7-SNAPSHOT.jar cpeGui
&lt;/pre&gt;


&lt;p&gt;Bien sûr, si vous n'avez pas installé le composant avec maven, il faudra modifier en conséquence les chemins du &lt;em&gt;UIMA_CLASSPATH&lt;/em&gt;.&lt;/p&gt;


&lt;h2&gt;Autres articles&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2009/11/06/UIMA-Wikipedia-%281%29-%3A-Proposition-de-Type-System&quot;&gt;UIMA &amp;amp; Wikipédia (1)&amp;nbsp;: Proposition de Type System&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/02/UIMA-Wikip%C3%A9dia-%282%29-%3A-Chargement-d-un-dump-Wikipedia&quot;&gt;UIMA &amp;amp; Wikipédia (2)&amp;nbsp;: Chargement d'un dump Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/12/UIMA-Wikip%C3%A9dia-%283%29-%3A-Filtrage-des-donn%C3%A9es-%C3%A0-charger&quot;&gt;UIMA &amp;amp; Wikipédia (3)&amp;nbsp;: Filtrage des données à charger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/14/UIMA-Wikip%C3%A9dia-%284%29-%3A-Analyse-syntaxique-du-langage-Wiki&quot;&gt;UIMA &amp;amp; Wikipédia (4)&amp;nbsp;: Analyse de la syntaxe MediaWiki&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/02/21/UIMA-Wikip%C3%A9dia-%285%29-%3A-Gestion-du-projet-avec-Maven#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/02/21/UIMA-Wikip%C3%A9dia-%285%29-%3A-Gestion-du-projet-avec-Maven#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/79</wfw:commentRss>
      </item>
    
  <item>
    <title>Un peu de sécurité : renforcer SSH</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/02/19/Un-peu-de-s%C3%A9curit%C3%A9-%3A-renforcer-la-s%C3%A9curit%C3%A9-de-SSH</link>
    <guid isPermaLink="false">urn:md5:9465ac388259920f3d1110795dfaa47b</guid>
    <pubDate>Fri, 19 Feb 2010 15:11:00 +0100</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Geek &amp; Technique</category>
        <category>debian</category><category>geek</category><category>linux</category><category>securité</category><category>ssh</category>    
    <description>&lt;p&gt;Après les annonces récentes concernant la sécurité des systèmes informatiques (&lt;a href=&quot;http://www.google.com/hostednews/afp/article/ALeqM5jPLmS0Zets8xLqmFzwN0CDOTP6MQ&quot; hreflang=&quot;fr&quot;&gt;ici&lt;/a&gt; ou &lt;a href=&quot;http://www.google.com/hostednews/afp/article/ALeqM5g7GzJQaKx5UhoVh88cc8mZPhtEEw&quot; hreflang=&quot;fr&quot;&gt;là&lt;/a&gt;), je me suis dit que ce serait pas mal de m'intéresser un peu à la sécurité de mon serveur.&lt;/p&gt;


&lt;p&gt;Je vais commencer par SSH étant donné qu'il s'agit du moyen le plus classique pour entrer sur le serveur.&lt;/p&gt;    &lt;h2&gt;Suis-je paranoïaque&amp;nbsp;?&lt;/h2&gt;


&lt;p&gt;Lorsque l'on s'intéresse à la sécurité informatique, on se demande toujours si l'on n'en fait pas un peu trop. Après tout je ne possède qu'un petit serveur personnel qui fait tourner quelques sites web et qui me sert à stocker des données diverses. Rien à voir avec les ordinateur du FBI, de la CIA ou de je ne sais quel &lt;a href=&quot;http://en.wikipedia.org/wiki/Hackers_%28film%29&quot; hreflang=&quot;fr&quot;&gt;super-ordinateur d'une compagnie pétrolière&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;J'ai donc dans un premier temps estimé le risque réellement encouru par ma machine en étudiant le contenu des fichiers de log de l'authentification (&lt;em&gt;/var/log/auth.log*&lt;/em&gt;). J'ai notamment recherché les messages de type &lt;em&gt;Invalid user&lt;/em&gt; et &lt;em&gt;Failed password&lt;/em&gt; qui concernent les tentatives d'intrusion par &lt;a href=&quot;http://fr.wikipedia.org/wiki/Attaque_par_force_brute&quot; hreflang=&quot;fr&quot;&gt;brute force&lt;/a&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ grep &amp;quot;Invalid user&amp;quot; /var/log/auth.log*
...
/var/log/auth.log:Feb 19 09:21:06 persephone sshd[609]: Invalid user marine from 211.7.45.195
/var/log/auth.log:Feb 19 09:21:11 persephone sshd[611]: Invalid user marine from 211.7.45.195
/var/log/auth.log:Feb 19 09:21:15 persephone sshd[613]: Invalid user marine from 211.7.45.195
...
$ grep &amp;quot;Failed password&amp;quot; /var/log/auth.log*
...
/var/log/auth.log:Feb 19 09:21:08 persephone sshd[609]: Failed password for invalid user marine from 211.7.45.195 port 33591 ssh2
/var/log/auth.log:Feb 19 09:21:13 persephone sshd[611]: Failed password for invalid user marine from 211.7.45.195 port 34941 ssh2
/var/log/auth.log:Feb 19 09:21:17 persephone sshd[613]: Failed password for invalid user marine from 211.7.45.195 port 35827 ssh2
...
&lt;/pre&gt;


&lt;p&gt;Et là j'ai un peu commencé à flipper&amp;nbsp;! 8 471 messages concernant une tentative de connexion avec un nom d'utilisateur invalide et 11 213 messages concernant une tentative de connexion avec un mauvais mot de passe, sur deux jours. J'ai développé &lt;a href=&quot;http://www.fabienpoulard.info/public/Hacking/Security/summarize-logs.py.gz&quot;&gt;un petit script python&lt;/a&gt; afin d'analyser ces tentatives d'intrusion.&lt;/p&gt;


&lt;h3&gt;Statistiques sur les noms d'utilisateur&lt;/h3&gt;


&lt;p&gt;En tout ce n'est pas moins de 3 158 noms d'utilisateurs différents qui ont été testé, dont moins d'1% correspondent à des noms d'utilisateurs existant réellement sur le système. Parmi les noms d'utilisateurs attaqués, on  trouve les classiques Unix/Linux&amp;nbsp;: &lt;em&gt;root&lt;/em&gt;, &lt;em&gt;postgresql&lt;/em&gt;, &lt;em&gt;mysql&lt;/em&gt;, &lt;em&gt;news&lt;/em&gt;, &lt;em&gt;games&lt;/em&gt;, ...&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://www.fabienpoulard.info/public/Hacking/Security/attacks-usernames-20100219.png&quot;&gt;&lt;img src=&quot;http://www.fabienpoulard.info/public/Hacking/Security/.attacks-usernames-20100219_s.jpg&quot; alt=&quot;Nombre d&amp;#039;attaques par nom d&amp;#039;utilisateurs (18 et 19 Fév. 2010)&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Nombre d&amp;#039;attaques par nom d&amp;#039;utilisateurs (18 et 19 Fév. 2010), fév. 2010&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h3&gt;Statistiques sur les dates&lt;/h3&gt;


&lt;p&gt;Sur deux jours il n'y a pas tellement d'intérêt à observer une évolution, et comme le montre le graphique ci-dessous, il n'y a pas tellement de période de la journée propice à une attaque.&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://www.fabienpoulard.info/public/Hacking/Security/attacks-hours-20100219.png&quot;&gt;&lt;img src=&quot;http://www.fabienpoulard.info/public/Hacking/Security/.attacks-hours-20100219_s.jpg&quot; alt=&quot;Nombre d&amp;#039;attaques par horaire (18 et 19 Fév. 2010)&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Nombre d&amp;#039;attaques par horaire (18 et 19 Fév. 2010), fév. 2010&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h3&gt;Statistiques sur les attaquants&lt;/h3&gt;


&lt;p&gt;Finalement, ce qui est assez surprenant, mais tant mieux pour moi, c'est que la liste des attaquants soit assez stable. Il s'agit certainement de script-kiddies des US, de Colombie, Chine...&lt;/p&gt;


&lt;table&gt;
  &lt;tr&gt;&lt;th&gt;IP&lt;/th&gt;&lt;th&gt;Nb. tentatives&lt;/th&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;173.1.4.196&lt;/td&gt;&lt;td&gt;2416&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;18.239.6.7&lt;/td&gt;&lt;td&gt;2154&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;190.144.99.98&lt;/td&gt;&lt;td&gt;1901&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;222.247.37.141&lt;/td&gt;&lt;td&gt;1642&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;67.23.14.188	&lt;/td&gt;&lt;td&gt;1157&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;160.80.97.45&lt;/td&gt;&lt;td&gt;789&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;212.174.28.15&lt;/td&gt;&lt;td&gt;304&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;124.137.4.142&lt;/td&gt;&lt;td&gt;292&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;88.191.74.61	&lt;/td&gt;&lt;td&gt;173&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;202.140.41.206&lt;/td&gt;&lt;td&gt;168&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;59.108.230.130&lt;/td&gt;&lt;td&gt;66&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;202.98.244.20&lt;/td&gt;&lt;td&gt;26&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;222.68.194.69&lt;/td&gt;&lt;td&gt;21&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;86.34.201.30&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;202.165.177.203&lt;/td&gt;&lt;td&gt;16&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;202.108.77.139&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;88.44.214.142&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;81.7.171.41&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;88.191.69.60&lt;/td&gt;&lt;td&gt;11&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;203.150.104.182&lt;/td&gt;&lt;td&gt;8&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;211.7.45.195	&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;200.69.106.147&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;80.13.112.50&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;



&lt;p&gt;Ce qui m'a surpris c'est que certaines venaient du très prestigieux MIT, du &lt;em&gt;Centro di Calcolo e Documentazione de l'Universita' degli Studi di Roma &quot;Tor Vergata&quot;&lt;/em&gt; ou encore du réseau &lt;a href=&quot;http://www.dedibox.fr/&quot; hreflang=&quot;fr&quot;&gt;dédibox&lt;/a&gt;. Le nombre d'attaques étant important et l'origine identifiée, je me suis fendu d'un petit mail à destination des administrateurs. Pour tous les autres, une petite règle &lt;em&gt;iptables&lt;/em&gt; permet de leur barrer la route&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ sudo iptables -A INPUT -p tcp -s XXX.XXX.XXX.XXX --destination-port 22 -j DROP
&lt;/pre&gt;


&lt;h2&gt;Renforcer le point d'entrée&amp;nbsp;: SSH&lt;/h2&gt;


&lt;p&gt;Toutes ces attaques ont été opérées sur mon serveur SSH. Autant dire qu'il s'agit du premier point à sécuriser.&lt;/p&gt;


&lt;p&gt;La première chose à faire est d'aller renforcer un petit peu la sécurité côté serveur en modifiant quelques valeurs dans le &lt;em&gt;/etc/ssh/sshd_config&lt;/em&gt;&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;LoginGraceTime&lt;/strong&gt; descendu à 30 secondes&amp;nbsp;: au bout de 30 secondes si la connexion ne s'est pas concrétisée, le lien est rompu.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PermitRootLogin&lt;/strong&gt; passé à &lt;em&gt;no&lt;/em&gt;&amp;nbsp;: l'utilisateur &lt;em&gt;root&lt;/em&gt; ne peut pas se connecter par SSH, il s'agit du compte le plus attaqué (largement).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PermitEmptyPasswords&lt;/strong&gt; passé à &lt;em&gt;no&lt;/em&gt;&amp;nbsp;: on ne sait jamais, un utilisateur suicidaire pourrait choisir de ne pas mettre de mot de passe&amp;nbsp;!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ensuite je me suis rendu compte que mon serveur SSH souffrait du problème de clés vulnérables (&lt;a href=&quot;http://www.debian.org/security/2008/dsa-1571&quot;&gt;bug Debian&lt;/a&gt;). Il est possible d'identifier les clés vulnérables à l'aide de l'outil dédié&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ sudo ssh-vulnkey -a
&lt;/pre&gt;


&lt;p&gt;La clé RSA d'authentification de mon serveur (&lt;em&gt;/etc/ssh/ssh_host_rsa_key.pub&lt;/em&gt;) étant vulnérable, je l'ai remplacée&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
$ sudo ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /etc/ssh/ssh_host_rsa_key
/etc/ssh/ssh_host_rsa_key already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
...
&lt;/pre&gt;


&lt;p&gt;Voilà une première étape de sécurisation... mais il y aurait encore certainement à faire.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/02/19/Un-peu-de-s%C3%A9curit%C3%A9-%3A-renforcer-la-s%C3%A9curit%C3%A9-de-SSH#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/02/19/Un-peu-de-s%C3%A9curit%C3%A9-%3A-renforcer-la-s%C3%A9curit%C3%A9-de-SSH#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/78</wfw:commentRss>
      </item>
    
  <item>
    <title>UIMA &amp; Wikipédia (4) : Analyse de la syntaxe MediaWiki</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/02/14/UIMA-Wikip%C3%A9dia-%284%29-%3A-Analyse-syntaxique-du-langage-Wiki</link>
    <guid isPermaLink="false">urn:md5:cf55a922d1928a91e7e8a5e474b70fc0</guid>
    <pubDate>Sun, 14 Feb 2010 14:35:00 +0100</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Sciences &amp; Recherche</category>
        <category>syntax</category><category>uima</category><category>wikipedia</category>    
    <description>&lt;p&gt;&lt;a href=&quot;http://fr.wikipedia.org&quot; hreflang=&quot;fr&quot;&gt;Wikipedia&lt;/a&gt; est une incroyable source d'information, de données et plus généralement d'actes langagiers (utilisation du langage). Ce dernier point est très important pour nous autres chercheurs en traitement automatique des langues. En effet, nous avons besoin d'observer de très nombreux exemples d'utilisation du langage, que ce soit de manière automatique ou manuelle. Pour ce faire, nous compilons de vastes exemples d'utilisation du langage sous forme de &lt;a href=&quot;http://fr.wikipedia.org/wiki/Corpus&quot; hreflang=&quot;fr&quot;&gt;corpus&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;La création de composants UIMA permettant d'accéder et tirer parti de Wikipédia offrirait de nouvelles perspectives au traitement des langues en offrant un accès aisé à cette formidable ressource que représente l'encyclopédie libre. Je compte m'atteler à la création de tels composants et vais tâcher de publier plusieurs billets décrivant ma démarche en cours.&lt;/p&gt;


&lt;p&gt;Voici le quatrième billet qui discute de l'analyse syntaxique du contenu des pages wiki pour la suppression des balises Wiki.&lt;/p&gt;    &lt;h2&gt;Analyse syntaxique des pages MediaWiki&lt;/h2&gt;


&lt;p&gt;Il existe plusieurs initiatives de programmes permettant d'interpréter &lt;a href=&quot;http://www.mediawiki.org/wiki/Help:Formatting&quot; hreflang=&quot;en&quot;&gt;la syntaxe&lt;/a&gt; de MediaWiki. Il y a le code PHP utilisé par MediaWiki et qui sert de référence, mais également &lt;a href=&quot;http://www.mediawiki.org/wiki/Alternative_parsers&quot; hreflang=&quot;en&quot;&gt;plusieurs autres initiatives&lt;/a&gt; notamment en Java.&lt;/p&gt;


&lt;p&gt;La plupart des initiatives Java ont pour objectif de produire des version XHTML ou PDF des pages en syntaxe wiki et ne donnent pas accès à l'arbre syntaxique de la page. &lt;a href=&quot;http://svn.wikimedia.org/svnroot/mediawiki/trunk/flexbisonparse/&quot;&gt;Un programme en C basé sur Flex/Bison&lt;/a&gt; et développé dans le cadre du projet MediaWiki offre cette possibilité.&lt;/p&gt;


&lt;p&gt;Parmi les initiatives en Java qui semblent intéressantes pour le &lt;em&gt;collection reader&lt;/em&gt; UIMA&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://jamwiki.org/&quot;&gt;JAMWiki&lt;/a&gt; qui est plus ou moins une réécriture de MediaWiki en Java et dont &lt;a href=&quot;http://jamwiki.org/wiki/en/Tech:JAMWiki_Design#Parser&quot; hreflang=&quot;en&quot;&gt;l'analyseur syntaxique&lt;/a&gt; semble réutilisable&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/wikimodel/&quot; hreflang=&quot;en&quot;&gt;WikiModel&lt;/a&gt; supporte plusieurs langages Wiki&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/gwtwiki/&quot; hreflang=&quot;en&quot;&gt;Bliki&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;J'ai tout d'abord essayé &lt;a href=&quot;http://code.google.com/p/gwtwiki/&quot; hreflang=&quot;en&quot;&gt;Bliki&lt;/a&gt; pour traiter la syntaxe de MediaWiki. Ce dernier s'est toutefois avéré assez complexe, notamment au niveau de son architecture, de telle façon que je n'ai pas réussi à obtenir ce que je voulais. Je me suis alors tourné vers &lt;a href=&quot;http://code.google.com/p/wikimodel/&quot; hreflang=&quot;en&quot;&gt;WikiModel&lt;/a&gt; qui offre un analyseur syntaxique (Wiki Event Model (WEM)) au fonctionnement proche de SAX.&lt;/p&gt;


&lt;h2&gt;WikiModel pour MediaWiki&lt;/h2&gt;


&lt;p&gt;Le gros avantage de &lt;a href=&quot;http://code.google.com/p/wikimodel&quot;&gt;WikModel&lt;/a&gt; est qu'il offre directement un parseur pour MediaWiki&amp;nbsp;: &lt;em&gt;org.wikimodel.wem.mediawiki.MediaWikiParser&lt;/em&gt;. Le parseur analyse du code Wiki brute et, comme un parseur SAX classique, lance des évènements à une instance implémentant l'interface &lt;em&gt;org.wikimodel.wem.IWemListener&lt;/em&gt;. J'ai choisi de créer une classe &lt;em&gt;MediawikiCasConverter&lt;/em&gt; implémentant cette interface et gérant elle même le lancement du parseur sur les textes brutes extraits des révisions.&lt;/p&gt;

&lt;pre class=&quot;java&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.wikimodel.wem.mediawiki.MediaWikiParser&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.wikimodel.wem.IWemListener;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; MediawikiCasConverter &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;implements&lt;/span&gt; IWemListener &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; MediawikiCasConverter&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    theParser = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; MediaWikiParser&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; runParser&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; rawWikiText&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;throws&lt;/span&gt; WikiParserException &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// We use a string reader to parse the raw wiki texte&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;StringReader&lt;/span&gt; reader = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;StringReader&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;rawWikiText&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Parsing&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    theParser.&lt;span style=&quot;color: #006600;&quot;&gt;parse&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;reader, &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// IWemListener methods below&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  ...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Les méthodes du &lt;em&gt;IWemListener&lt;/em&gt; sont de deux types. Les premières sont des méthodes &lt;em&gt;one shot&lt;/em&gt;, ie elles sont appelées une seule fois lorsqu'un élément est rencontré. Ce sont notamment celles qui concernent le texte et leur mise en forme&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;onEscape(String str)&lt;/li&gt;
&lt;li&gt;onSpace(String str)&lt;/li&gt;
&lt;li&gt;onSpecialSymbol(String str)&lt;/li&gt;
&lt;li&gt;onWord(String str)&lt;/li&gt;
&lt;li&gt;onReference(String str)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Les secondes sont des méthodes à la SAX en deux temps&amp;nbsp;: &lt;em&gt;begin&lt;/em&gt; et &lt;em&gt;end&lt;/em&gt;. Ce sont notamment celles qui concernent la structuration du texte&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;beginHeader(int headerLevel, WikiParameters params)&lt;/li&gt;
&lt;li&gt;endHeader(int headerLevel, WikiParameters params)&lt;/li&gt;
&lt;li&gt;beginSection(int docLevel, int headerLevel, WikiParameters params)&lt;/li&gt;
&lt;li&gt;endSection(int docLevel, int headerLevel, WikiParameters params)&lt;/li&gt;
&lt;li&gt;beginParagraph(WikiParameters params)&lt;/li&gt;
&lt;li&gt;endParagraph(WikiParameters params)&lt;/li&gt;
&lt;li&gt;beginList(WikiParameters params, boolean ordered)&lt;/li&gt;
&lt;li&gt;endList(WikiParameters params, boolean ordered)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;La plupart de ces méthodes ne font que des appels à une fonction de plus haut niveau qui collecte les données textuelles de la page et qui maintient l'index du CAS&amp;nbsp;: &lt;em&gt;addToContent&lt;/em&gt;. C'est notamment le cas pour la méthode &lt;em&gt;onWord&lt;/em&gt; qui est appelée lorsque le parseur rencontre un nouveau mot&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;java&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* This method adds the string in parameter into the collected content&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* and then increment the offset by the size of this string.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* @param str the string to be added to the content&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; addToContent&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; str&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; str &lt;span style=&quot;color: #66cc66;&quot;&gt;!&lt;/span&gt;= &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    theTextContent.&lt;span style=&quot;color: #006600;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;str&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    theOffset += str.&lt;span style=&quot;color: #006600;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;...&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/** Called when a word is encountered */&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; onWord&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; str&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  addToContent&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;str&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;J'ai choisi de transposer une partie des informations contenues dans les pages de Wikipedia sous la forme d'annotations. J'ai ainsi ajouté les types&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Header&lt;/strong&gt; pour les titres qui possède un attribut &lt;em&gt;Level&lt;/em&gt; indiquant le niveau de titre&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Paragraph&lt;/strong&gt; pour différencier les paragraphes&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Section&lt;/strong&gt; pour repérer les sections même si je ne suis pas certain d'avoir bien compris le principe de section dans MediaWiki. Ce type possède les attributs &lt;em&gt;Level&lt;/em&gt; pour le niveau de section (&lt;em&gt;cf. niveau de titre&lt;/em&gt;), &lt;em&gt;Parent&lt;/em&gt; pointant sur la section parente et &lt;em&gt;Title&lt;/em&gt; pointant sur le Header correspondant à ladite section&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Link&lt;/strong&gt; pour les liens divers et variés qui possède des attributs &lt;em&gt;Label&lt;/em&gt; et &lt;em&gt;Link&lt;/em&gt; pour respectivement l'étiquette du lien et son adresse.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;En ce qui concerne les liens, j'ai choisi pour le moment d'ignorer les images qui me semblent apporter plus de bruit qu'autre chose.&lt;/p&gt;


&lt;p&gt;La mise en place de ces annotations se fait assez facilement&amp;nbsp;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Lors d'un appel à &lt;em&gt;begin...&lt;/em&gt;, l'annotation est créée est stockée dans une liste, la plupart des informations excepté son index de fin est renseigné à ce moment&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Lors de l'appel correspondant à &lt;em&gt;end...&lt;/em&gt;, la dernière annotation de la liste est récupérée et on fixe son index de fin (&lt;em&gt;setEnd&lt;/em&gt;)&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Lorsque l'analyse est terminée, toutes les annotations sont accessibles par la méthode &lt;em&gt;getAnnotations&lt;/em&gt; afin de les ajouter à l'index du CAS.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cette approche permet de dédier toute la partie analyse à une classe. Si jamais l'on veut ignorer certaines annotations (ou toutes), il suffit de les filtrer au moment de leur récupérer par &lt;em&gt;getAnnotations&lt;/em&gt;. L'extrait de code ci-dessous illustre ce fonctionnement pour les titres&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;java&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* When we encounter a new header, we create an annotation for it.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; beginHeader&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; headerLevel, WikiParameters params&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Jump a line&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  addToContent&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;
&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Create the annotation&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  Header header = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Header&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;theCas&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  header.&lt;span style=&quot;color: #006600;&quot;&gt;setLevel&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;headerLevel&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  header.&lt;span style=&quot;color: #006600;&quot;&gt;setBegin&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; theOffset &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Add it to the list&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  theHeadersAnnotations.&lt;span style=&quot;color: #006600;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; header &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Add it as header of the last unclosed section&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; theUnclosedSections.&lt;span style=&quot;color: #006600;&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    Section section = theUnclosedSections.&lt;span style=&quot;color: #006600;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; theUnclosedSections.&lt;span style=&quot;color: #006600;&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-1&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;    section.&lt;span style=&quot;color: #006600;&quot;&gt;setTitle&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;header&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;* Add the ending value of the last started header.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; endHeader&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; headerLevel, WikiParameters params&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Retrieve the last header&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  Header header = theHeadersAnnotations.&lt;span style=&quot;color: #006600;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; theHeadersAnnotations.&lt;span style=&quot;color: #006600;&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-1&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Update its ending value&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  header.&lt;span style=&quot;color: #006600;&quot;&gt;setEnd&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; theOffset &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Jump a line&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;  addToContent&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;
&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: 'Courier New', Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;


&lt;p&gt;Je me suis rendu compte que le parseur posait des problèmes (&lt;em&gt;heap overflow&lt;/em&gt;) sur des pages de certains espaces de noms. J'ai donc choisi de n'appliquer l'analyse syntaxique qu'aux pages de l'espace de nom 0 (espace de nom principal). Ceci est toutefois facilement modifiable dans la méthode &lt;em&gt;uima.wikipedia.mwdumper.ThreadedMWDumper.writeStartPage&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;Il reste pas mal d'améliorations possibles&amp;nbsp;: prendre en compte toutes les mises en formes/structurations, prendre en charge les macros, rendre l'analyse syntaxique configurable. Toutefois, le composant est dans l'état actuel aussi complet et performant que je le souhaitais à l'origine. Il ne reste plus qu'à le tester de manière intensive. J'ai d'ailleurs deux trois cobayes en tête pour ça.&lt;/p&gt;


&lt;h2&gt;Nouvelle version du composant&lt;/h2&gt;


&lt;p&gt;Pas de nouvelle version du composant pour l'instant. Étant donné que les dépendances se sont multipliées, et que le composant est désormais suffisamment fonctionnel pour se voir estampillé &lt;em&gt;1.0&lt;/em&gt; ou quelque chose du genre, je vais travailler un peu plus &lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/21/UIMA-Wikip%C3%A9dia-%285%29-%3A-Gestion-du-projet-avec-Maven&quot;&gt;son packaging&lt;/a&gt;.&lt;/p&gt;


&lt;h2&gt;Autres articles&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2009/11/06/UIMA-Wikipedia-%281%29-%3A-Proposition-de-Type-System&quot;&gt;UIMA &amp;amp; Wikipédia (1)&amp;nbsp;: Proposition de Type System&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/02/UIMA-Wikip%C3%A9dia-%282%29-%3A-Chargement-d-un-dump-Wikipedia&quot;&gt;UIMA &amp;amp; Wikipédia (2)&amp;nbsp;: Chargement d'un dump Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/12/UIMA-Wikip%C3%A9dia-%283%29-%3A-Filtrage-des-donn%C3%A9es-%C3%A0-charger&quot;&gt;UIMA &amp;amp; Wikipédia (3)&amp;nbsp;: Filtrage des données à charger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/21/UIMA-Wikip%C3%A9dia-%285%29-%3A-Gestion-du-projet-avec-Maven&quot;&gt;UIMA &amp;amp; Wikipédia (5)&amp;nbsp;: Gestion du projet avec Maven&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/02/14/UIMA-Wikip%C3%A9dia-%284%29-%3A-Analyse-syntaxique-du-langage-Wiki#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/02/14/UIMA-Wikip%C3%A9dia-%284%29-%3A-Analyse-syntaxique-du-langage-Wiki#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/77</wfw:commentRss>
      </item>
    
  <item>
    <title>UIMA &amp; Wikipédia (3) : Filtrage des données à charger</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/02/12/UIMA-Wikip%C3%A9dia-%283%29-%3A-Filtrage-des-donn%C3%A9es-%C3%A0-charger</link>
    <guid isPermaLink="false">urn:md5:543dc46d5982b397c6e6642e7ac5a9af</guid>
    <pubDate>Fri, 12 Feb 2010 14:56:00 +0100</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Sciences &amp; Recherche</category>
        <category>uima</category><category>wikipedia</category>    
    <description>&lt;p&gt;&lt;a href=&quot;http://fr.wikipedia.org&quot; hreflang=&quot;fr&quot;&gt;Wikipedia&lt;/a&gt; est une incroyable source d'information, de données et plus généralement d'actes langagiers (utilisation du langage). Ce dernier point est très important pour nous autres chercheurs en traitement automatique des langues. En effet, nous avons besoin d'observer de très nombreux exemples d'utilisation du langage, que ce soit de manière automatique ou manuelle. Pour ce faire, nous compilons de vastes exemples d'utilisation du langage sous forme de &lt;a href=&quot;http://fr.wikipedia.org/wiki/Corpus&quot; hreflang=&quot;fr&quot;&gt;corpus&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;La création de composants UIMA permettant d'accéder et tirer parti de Wikipédia offrirait de nouvelles perspectives au traitement des langues en offrant un accès aisé à cette formidable ressource que représente l'encyclopédie libre. Je compte m'atteler à la création de tels composants et vais tâcher de publier plusieurs billets décrivant ma démarche en cours.&lt;/p&gt;


&lt;p&gt;Voici le troisième billet qui discute du filtrage des données à charger&amp;nbsp;: articles, révision, ...&lt;/p&gt;    &lt;h2&gt;Filtres de MWDumper&lt;/h2&gt;


&lt;p&gt;L'outil &lt;em&gt;mwdumper&lt;/em&gt; inclut un certain nombre de filtres commandables &lt;a href=&quot;http://www.mediawiki.org/wiki/MWDumper#Filter_actions&quot; hreflang=&quot;en&quot;&gt;à partir de la ligne de commande&lt;/a&gt;&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;LatestFilter&lt;/strong&gt; permet de ne conserver que la dernière révision d'une page&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;NamespaceFilter&lt;/strong&gt; permet de ne conserver que les articles qui appartiennent à un espace de nom particulier (passé en paramètre)&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;NotalkFilter&lt;/strong&gt; permet d'ignorer les pages de discussion&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TitleMatchFilter&lt;/strong&gt; permet de ne conserver que les pages dont le titre valide une &lt;a href=&quot;http://fr.wikipedia.org/wiki/Expression_rationnelle&quot; hreflang=&quot;fr&quot;&gt;expression rationnelle&lt;/a&gt; donnée en paramètre&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ListFilter&lt;/strong&gt; permet de ne conserver que les pages dont le titre de la page de données ou de discussion est présent dans un fichier passé en paramètre (un nom de page par ligne)&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ExactListFilter&lt;/strong&gt; est identique au filtre précédent si ce n'est que son application est plus stricte car seul le titre de la page est considéré&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RevisionListFilter&lt;/strong&gt; reprend le principe des filtres précédents si ce n'est qu'il s'applique aux identifiants de révisions&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;BeforeTimeStampFilter&lt;/strong&gt; ne conserve que les données produites avant une date passée en paramètre&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AfterTimeStampFilter&lt;/strong&gt; ne conserve que les données produites après une date passée en paramètre&amp;nbsp;;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Voir le billet &lt;em&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2009/11/18/Ins%C3%A9rer-plusieurs-copies-locales-de-Wikipedia-dans-une-base-PostgreSQL#Filtrage des pages à extraire&quot;&gt;Insérer plusieurs copies locales de Wikipedia dans une base PostgreSQL&lt;/a&gt;&lt;/em&gt; pour un cas d'utilisation de ces filtres. La combinaison de ces filtres permet de contrôler avec précision les données à charger, nous allons donc nous en contenter.&lt;/p&gt;


&lt;h2&gt;Paramétrage du composant&lt;/h2&gt;


&lt;p&gt;On peut classer les filtres en deux familles&amp;nbsp;: ceux qui nécessitent des paramètres et ceux qui n'en nécessitent pas. J'ai donc choisi pour le moment d'utiliser des paramètres &lt;em&gt;booléens&lt;/em&gt; pour les filtres sans paramètre, et des paramètres &lt;em&gt;chaînes de caractères&lt;/em&gt; pour les autres.&lt;/p&gt;


&lt;p&gt;L'activation des paramètres booléens suffit à activer les filtres correspondant&amp;nbsp;: &lt;em&gt;IgnoreTalks&lt;/em&gt; et &lt;em&gt;LatestRevisionOnly&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;Pour activer les autres filtres il suffit de les configurer en renseignant les champs dédiés. Si les champs restent non renseignés alors les filtres ne sont pas activés&amp;nbsp;: &lt;em&gt;ConfigNamespacesFilter&lt;/em&gt;, &lt;em&gt;ConfigTitleMatch&lt;/em&gt;, &lt;em&gt;ConfigListFilter&lt;/em&gt;, &lt;em&gt;ConfigExactListFilter&lt;/em&gt;, &lt;em&gt;ConfigRevisionListFilter&lt;/em&gt;, &lt;em&gt;ConfigBeforeTimestampFilter&lt;/em&gt;, &lt;em&gt;ConfigAfterTimestampFilter&lt;/em&gt;.&lt;/p&gt;


&lt;h2&gt;Nouvelle version&lt;/h2&gt;


&lt;p&gt;Voici &lt;a href=&quot;http://www.uima-fr.org/download/uima-wikipedia-loader-v0.2.jar&quot;&gt;une nouvelle version du collection reader pour Wikipédia&lt;/a&gt;, estampillée 0.2, qui ne prend toujours pas en compte la syntaxe, mais qui permet de filtrer le type de contenu à charger à partir du dump XML. Pour utiliser le composant, il est nécessaire d'avoir le jar de &lt;a href=&quot;http://svn.wikimedia.org/svnroot/mediawiki/trunk/mwdumper/&quot;&gt;mwdumper&lt;/a&gt;  dans le classpath.&lt;/p&gt;


&lt;h2&gt;Autres articles&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2009/11/06/UIMA-Wikipedia-%281%29-%3A-Proposition-de-Type-System&quot;&gt;UIMA &amp;amp; Wikipédia (1)&amp;nbsp;: Proposition de Type System&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/02/UIMA-Wikip%C3%A9dia-%282%29-%3A-Chargement-d-un-dump-Wikipedia&quot;&gt;UIMA &amp;amp; Wikipédia (2)&amp;nbsp;: Chargement d'un dump Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/14/UIMA-Wikip%C3%A9dia-%284%29-%3A-Analyse-syntaxique-du-langage-Wiki&quot;&gt;UIMA &amp;amp; Wikipédia (4)&amp;nbsp;: Analyse de la syntaxe MediaWiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/21/UIMA-Wikip%C3%A9dia-%285%29-%3A-Gestion-du-projet-avec-Maven&quot;&gt;UIMA &amp;amp; Wikipédia (5)&amp;nbsp;: Gestion du projet avec Maven&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/02/12/UIMA-Wikip%C3%A9dia-%283%29-%3A-Filtrage-des-donn%C3%A9es-%C3%A0-charger#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/02/12/UIMA-Wikip%C3%A9dia-%283%29-%3A-Filtrage-des-donn%C3%A9es-%C3%A0-charger#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/76</wfw:commentRss>
      </item>
    
  <item>
    <title>UIMA &amp; Wikipédia (2) : Chargement d'un dump Wikipedia</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2010/02/02/UIMA-Wikip%C3%A9dia-%282%29-%3A-Chargement-d-un-dump-Wikipedia</link>
    <guid isPermaLink="false">urn:md5:474d8649d7531210442317a2599932d8</guid>
    <pubDate>Tue, 02 Feb 2010 14:05:00 +0100</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Sciences &amp; Recherche</category>
        <category>java</category><category>uima</category><category>wikipedia</category>    
    <description>&lt;p&gt;&lt;a href=&quot;http://fr.wikipedia.org&quot; hreflang=&quot;fr&quot;&gt;Wikipedia&lt;/a&gt; est une incroyable source d'information, de données et plus généralement d'actes langagiers (utilisation du langage). Ce dernier point est très important pour nous autres chercheurs en traitement automatique des langues. En effet, nous avons besoin d'observer de très nombreux exemples d'utilisation du langage, que ce soit de manière automatique ou manuelle. Pour ce faire, nous compilons de vastes exemples d'utilisation du langage sous forme de &lt;a href=&quot;http://fr.wikipedia.org/wiki/Corpus&quot; hreflang=&quot;fr&quot;&gt;corpus&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;La création de composants UIMA permettant d'accéder et tirer parti de Wikipédia offrirait de nouvelles perspectives au traitement des langues en offrant un accès aisé à cette formidable ressource que représente l'encyclopédie libre. Je compte m'atteler à la création de tels composants et vais tâcher de publier plusieurs billets décrivant ma démarche en cours.&lt;/p&gt;


&lt;p&gt;Voici le second billet qui discute du chargement d'un dump XML de l'encyclopédie libre et la distribution du contenu sous forme de CAS.&lt;/p&gt;    &lt;h2&gt;Wikipédia, formats brutes&lt;/h2&gt;


&lt;p&gt;La base de données contenant toutes les pages de Wikipédia et autre sites de la fondation WikiMedia est automatiquement archivée très régulièrement. Les &lt;em&gt;dumps&lt;/em&gt; de la base sont disponibles sur &lt;a href=&quot;http://download.wikimedia.org/&quot; hreflang=&quot;en&quot;&gt;http://download.wikimedia.org/&lt;/a&gt;. Vous trouverez ainsi&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;les &lt;a href=&quot;http://download.wikipedia.org/frwiki/&quot;&gt;archives de la Wikipédia française&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;les &lt;a href=&quot;http://download.wikipedia.org/wikinews/&quot;&gt;archives de WikiNews&lt;/a&gt; ou juste &lt;a href=&quot;http://download.wikipedia.org/frwikinews/&quot;&gt;la partie en français&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;les &lt;a href=&quot;http://download.wikipedia.org/wikiversity/&quot;&gt;archives de la Wikiversity&lt;/a&gt; ou juste &lt;a href=&quot;http://download.wikipedia.org/frwikiversity/&quot;&gt;la partie en français&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;les &lt;a href=&quot;http://download.wikipedia.org/frwikibooks/&quot;&gt;archives des WikiBooks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Il est également possible de télécharger l'intégralité de l'encyclopédie dépourvue des balises wiki&amp;nbsp;: &lt;a href=&quot;http://download.wikimedia.org/nowiki/&quot;&gt;http://download.wikimedia.org/nowiki/&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Le billet &lt;em&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2009/07/21/Cr%C3%A9er-un-miroir-Wikipedia&quot;&gt;Créer un miroir Wikipédia&lt;/a&gt;&lt;/em&gt; explique comment construire une copie locale de l'encyclopédie à partir de ces différents dumps. Nous nous donnons comme objectif d'exploiter ces dumps directement sans passer par une importation en base de données.&lt;/p&gt;


&lt;h2&gt;L'outil d'exportation et d'importation de MediaWiki&amp;nbsp;: mwdump&lt;/h2&gt;


&lt;p&gt;&lt;a href=&quot;http://www.mediawiki.org/wiki/MWDumper&quot; hreflang=&quot;en&quot;&gt;MWDumper&lt;/a&gt; est un outil écrit en Java par les développeurs de MediaWiki qui permet d'importer/exporter une base MediaWiki à partir de/vers une base de données. Cet outil a l'avantage de travailler directement sur la version compressée du dump XML, réduisant ainsi le besoin en espace disque disponible. Cet outil s'utilise en ligne de commande et offre un certain nombre de paramètres permettant notamment de filtrer les articles à exporter ou bien le format SQL à prendre en charge.&lt;/p&gt;


&lt;p&gt;Une version compilée de l'outil est disponible sur &lt;a href=&quot;http://download.wikimedia.org/tools/&quot;&gt;download.wikipedia.org&lt;/a&gt;, mais il y a de forte chance qu'elle soit dépassée. Le plus sûr est de compiler l'outil depuis &lt;a href=&quot;http://svn.wikimedia.org/svnroot/mediawiki/trunk/mwdumper/&quot;&gt;les sources&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Une partie du code de cet outil va nous faciliter la tâche pour la réalisation d'un &lt;em&gt;collection reader&lt;/em&gt; pour UIMA, notamment les classes&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;org.mediawiki.importer.XmlDumpReader&lt;/li&gt;
&lt;li&gt;org.mediawiki.importer.DumpWriter&lt;/li&gt;
&lt;li&gt;org.mediawiki.importer.Page&lt;/li&gt;
&lt;li&gt;org.mediawiki.importer.Revision&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Il nous faut toutefois noter que &lt;em&gt;XmlDumpReader&lt;/em&gt; repose sur un analyseur SAX, ce qui n'est pas directement utilisable dans un &lt;em&gt;Collection Reader&lt;/em&gt; d'UIMA. En effet, dans UIMA c'est le &lt;em&gt;Collection Reader&lt;/em&gt; qui contrôle l'exécution, alors qu'à l'opposé l'analyseur SAX contrôle sa propre exécution. La seule interaction avec le parseur est l'emploi des hooks.&lt;/p&gt;


&lt;p&gt;L'idée est de faire tourner l'analyseur SAX dans un thread différent de celui du collection reader. Ensuite à l'aide d'un mécanisme de sémaphore (ou de &lt;em&gt;monitor&lt;/em&gt; en Java), on contrôle l'exécution du parseur pour produire les CAS. Cette méthode permet d'utiliser presque directement l'outil de MediaWiki, ainsi si la syntaxe évolue, l'outil de MediaWiki évoluera également certainement et ce sera donc normalement transparent pour le collection reader.&lt;/p&gt;


&lt;h2&gt;Une première version de collection reader pour Wikipedia&lt;/h2&gt;


&lt;p&gt;Voici &lt;a href=&quot;http://www.uima-fr.org/download/uima-wikipedia-loader-v0.1.jar&quot;&gt;une première version du collection reader pour Wikipédia&lt;/a&gt; qui ne prend pas du tout en compte la syntaxe, mais charge seulement le contenu des pages dans un CAS. Il y a encore beaucoup de travail pour obtenir quelque chose d'intéressant et d'utilisable, d'où l'estampillage &lt;em&gt;0.1&lt;/em&gt;. Pour utiliser le composant, il est nécessaire d'avoir le jar de &lt;a href=&quot;http://svn.wikimedia.org/svnroot/mediawiki/trunk/mwdumper/&quot;&gt;mwdumper&lt;/a&gt; dans le classpath.&lt;/p&gt;


&lt;p&gt;Il y a tout un tas d'améliorations que j'aimerais apporter (filtrage, analyse de la syntaxe wiki, ...) mais l'idée est dans un premier temps de fournir une version brute de fonderie qui fonctionne pour qu'elle puisse être testée. Le &lt;a href=&quot;http://www.uima-fr.org/download/uima-wikipedia-loader-v0.1.jar&quot;&gt;jar&lt;/a&gt; contient notamment le code Java, donc il ne faut pas hésiter à y jeter un oeil.&lt;/p&gt;


&lt;p&gt;Le descripteur est dans le Jar distribué, il ne prend en paramètre que le chemin vers le dump XML à charger. Peu importe l'extension (.gz, .bz, ...), il devrait pouvoir s'en sortir. Si ce n'est pas le cas, laissez un commentaire&amp;nbsp;! Je n'ai fait que peu de tests pour le moment, je ne sais pas trop comment le composant tient la route sur des gros dumps, mais la première remarque est qu'il est nécessaire d'augmenter la taille du tas de la jvm (&lt;em&gt;-Xmx=512m&lt;/em&gt; pour commencer). En effet, certaines pages sont assez imposantes de par leur grand nombre de révisions, et pour l'instant toutes les révisions sont chargées dans chaque CAS.&lt;/p&gt;


&lt;h2&gt;Autres billets&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2009/11/06/UIMA-Wikipedia-%281%29-%3A-Proposition-de-Type-System&quot;&gt;UIMA &amp;amp; Wikipédia (1)&amp;nbsp;: Proposition de Type System&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/12/UIMA-Wikip%C3%A9dia-%283%29-%3A-Filtrage-des-donn%C3%A9es-%C3%A0-charger&quot;&gt;UIMA &amp;amp; Wikipédia (3)&amp;nbsp;: Filtrage des données à charger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/14/UIMA-Wikip%C3%A9dia-%284%29-%3A-Analyse-syntaxique-du-langage-Wiki&quot;&gt;UIMA &amp;amp; Wikipédia (4)&amp;nbsp;: Analyse de la syntaxe MediaWiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/21/UIMA-Wikip%C3%A9dia-%285%29-%3A-Gestion-du-projet-avec-Maven&quot;&gt;UIMA &amp;amp; Wikipédia (5)&amp;nbsp;: Gestion du projet avec Maven&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2010/02/02/UIMA-Wikip%C3%A9dia-%282%29-%3A-Chargement-d-un-dump-Wikipedia#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2010/02/02/UIMA-Wikip%C3%A9dia-%282%29-%3A-Chargement-d-un-dump-Wikipedia#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/75</wfw:commentRss>
      </item>
    
  <item>
    <title>UIMA &amp; Wikipédia (1) : Proposition de Type System</title>
    <link>http://www.fabienpoulard.info/dotclear.php?post/2009/11/06/UIMA-Wikipedia-%281%29-%3A-Proposition-de-Type-System</link>
    <guid isPermaLink="false">urn:md5:7543737652ad4bc3a70d987c2cc39c60</guid>
    <pubDate>Mon, 01 Feb 2010 02:15:00 +0100</pubDate>
    <dc:creator>Fabien Poulard</dc:creator>
        <category>Sciences &amp; Recherche</category>
        <category>typesystem</category><category>uima</category><category>wikipedia</category>    
    <description>&lt;p&gt;&lt;a href=&quot;http://fr.wikipedia.org&quot; hreflang=&quot;fr&quot;&gt;Wikipedia&lt;/a&gt; est une incroyable source d'information, de données et plus généralement d'actes langagiers (utilisation du langage). Ce dernier point est très important pour nous autres chercheurs en traitement automatique des langues. En effet, nous avons besoin d'observer de très nombreux exemples d'utilisation du langage, que ce soit de manière automatique ou manuelle. Pour ce faire, nous compilons de vastes exemples d'utilisation du langage sous forme de &lt;a href=&quot;http://fr.wikipedia.org/wiki/Corpus&quot; hreflang=&quot;fr&quot;&gt;corpus&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;La création de composants UIMA permettant d'accéder et tirer parti de Wikipédia offrirait de nouvelles perspectives au traitement des langues en offrant un accès aisé à cette formidable ressource que représente l'encyclopédie libre. Je compte m'atteler à la création de tels composants et vais tâcher de publier plusieurs billets décrivant ma démarche en cours.&lt;/p&gt;


&lt;p&gt;Voici le premier billet qui discute de la création d'un Type System approprié pour représenter les pages de Wikipedia.&lt;/p&gt;    &lt;h2&gt;Wikipédia, structuration des données&lt;/h2&gt;


&lt;p&gt;L'encyclopédie  Wikipédia contient tout un tas d'informations mais je me concentrerai particulièrement sur le contenu même&amp;nbsp;: les articles.  Je propose de classer les informations concernant ces derniers en quatre grandes catégories&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Position de l'article dans l'encyclopédie (portail, catégories, ...)&lt;/li&gt;
&lt;li&gt;Versions de l'article (révisions, ...)&lt;/li&gt;
&lt;li&gt;Structuration de l'article (titre, sous-titre, ...)&lt;/li&gt;
&lt;li&gt;Macros et mise en forme du texte (gras, italique, ...)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Position de l'article dans l'encyclopédie&lt;/h3&gt;


&lt;p&gt;On peut considérer la Wikipédia comme un ensemble de pages liées selon trois grandes relations&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://fr.wikipedia.org/wiki/Aide:Cat%C3%A9gorie&quot;&gt;Les catégories&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://fr.wikipedia.org/wiki/Aide:Lien_inter-langue&quot;&gt;Les liens interlangues&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://fr.wikipedia.org/wiki/Aide:Liens_internes&quot;&gt;Les liens internes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Les catégories structurent l'encyclopédie à la manière d'une ontologie ou d'un &lt;a href=&quot;http://fr.wikipedia.org/wiki/Th%C3%A9saurus&quot;&gt;thésaurus&lt;/a&gt;. Une page peut appartenir à une ou plusieurs catégories. De plus, les catégories sont hiérarchisées, l'appartenance à une catégorie implique l'appartenance à toutes les catégories parentes.&lt;/p&gt;


&lt;p&gt;Les liens interlangues marquent les pages en relation de traduction avec la page courante.&lt;/p&gt;


&lt;p&gt;Les liens internes permettent au sein d'une page de faire référence à d'autres pages de l'encyclopédie, il s'agit d'une structuration qui n'a qu'un impact local. La signification de ces références est très variable et difficilement identifiable.&lt;/p&gt;


&lt;h3&gt;Versions de l'article&lt;/h3&gt;


&lt;p&gt;Le principe de l'encyclopédie collaborative est que tout le monde peut modifier un article, ce qui amène à de multiples révisions de ces derniers. Lorsque vous cliquez sur l'onglet &lt;em&gt;Historique&lt;/em&gt; d'un article, vous pouvez visionner ces différentes révisions, leur auteur, et éventuellement un commentaire précisant l'apport de la révision.&lt;/p&gt;


&lt;h3&gt;Structuration d'un article&lt;/h3&gt;


&lt;p&gt;Le contenu d'un article se structure à l'aide de titres, de paragraphes ainsi que de divers éléments de mise en forme&amp;nbsp;: &lt;a href=&quot;http://fr.wikipedia.org/wiki/Aide:Tableau&quot; hreflang=&quot;fr&quot;&gt;[tableaux&lt;/a&gt;], &lt;a href=&quot;http://fr.wikipedia.org/wiki/Aide:Formules_TeX&quot; hreflang=&quot;fr&quot;&gt;[formules&lt;/a&gt;], &lt;a href=&quot;http://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Ordonnancement_des_listes&quot; hreflang=&quot;fr&quot;&gt;[listes&lt;/a&gt;], ...&lt;/p&gt;


&lt;p&gt;Parmi les éléments de mise en forme, on peut également noter l'existence de plusieurs macros pour les &lt;a href=&quot;http://fr.wikipedia.org/wiki/Aide:Mod%C3%A8le&quot; hreflang=&quot;fr&quot;&gt;[modèles&lt;/a&gt;], &lt;a href=&quot;http://fr.wikipedia.org/wiki/Aide:Dates&quot; hreflang=&quot;fr&quot;&gt;[dates&lt;/a&gt;], &lt;a href=&quot;http://fr.wikipedia.org/wiki/Aide:Lien_interwiki&quot; hreflang=&quot;fr&quot;&gt;[liens interwiki&lt;/a&gt;], ...&lt;/p&gt;


&lt;h2&gt;Choix d'un Type System&lt;/h2&gt;


&lt;p&gt;Je ne crois personnellement pas à l'existence de Type Systems génériques pouvant être partagés par tous les composants. De mon point de vue, un Type System va être approprié au traitement d'une tâche particulière, chercher à en produire un suffisamment générique pour toutes les tâches seraient une perte de temps et mènerait certainement à un TS difficile à utiliser.&lt;/p&gt;


&lt;p&gt;Personnellement, je vais utiliser Wikipedia dans le cadre de ma thèse sur la détection de dérivation de texte. Ce qui m'intéresse c'est donc de générer un CAS par article dans lequel on retrouvera les différentes révisions dudit article. Je m'intéresse donc&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;à la notion d'article&lt;/li&gt;
&lt;li&gt;aux notions de révision&lt;/li&gt;
&lt;li&gt;à la structuration du contenu d'un article à l'aide des titres et des paragraphes&lt;/li&gt;
&lt;li&gt;au texte&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Après réflexion j'en suis donc arrivé à &lt;a href=&quot;http://www.fabienpoulard.info/public/UIMA/Wikipedia/wikipedia-ts.dia&quot;&gt;cette modélisation&lt;/a&gt;&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://www.fabienpoulard.info/public/UIMA/Wikipedia/wikipedia-ts.png&quot;&gt;&lt;img src=&quot;http://www.fabienpoulard.info/public/UIMA/Wikipedia/.wikipedia-ts_m.jpg&quot; alt=&quot;TS Wikipedia (png)&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;TS Wikipedia (png), fév. 2010&quot; /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Cette modélisation ne correspond pas exactement aux besoins d'un TS UIMA. Ainsi, les relations de composition se manifestent par un phénomène de couverture des annotations, entraînant la disparition des attributs correspondant.&lt;/p&gt;


&lt;p&gt;Vous trouverez le descripteurs correspondant à ce TS &lt;a href=&quot;http://www.fabienpoulard.info/public/UIMA/Wikipedia/wikipedia-ts.xml&quot;&gt;ici&lt;/a&gt;.&lt;/p&gt;



&lt;h2&gt;Autres billets&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/02/UIMA-Wikip%C3%A9dia-%282%29-%3A-Chargement-d-un-dump-Wikipedia&quot;&gt;UIMA &amp;amp; Wikipédia (2)&amp;nbsp;: Chargement d'un dump Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/12/UIMA-Wikip%C3%A9dia-%283%29-%3A-Filtrage-des-donn%C3%A9es-%C3%A0-charger&quot;&gt;UIMA &amp;amp; Wikipédia (3)&amp;nbsp;: Filtrage des données à charger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/14/UIMA-Wikip%C3%A9dia-%284%29-%3A-Analyse-syntaxique-du-langage-Wiki&quot;&gt;UIMA &amp;amp; Wikipédia (4)&amp;nbsp;: Analyse de la syntaxe MediaWiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fabienpoulard.info/index.php?post/2010/02/21/UIMA-Wikip%C3%A9dia-%285%29-%3A-Gestion-du-projet-avec-Maven&quot;&gt;UIMA &amp;amp; Wikipédia (5)&amp;nbsp;: Gestion du projet avec Maven&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
    
    
    
          <comments>http://www.fabienpoulard.info/dotclear.php?post/2009/11/06/UIMA-Wikipedia-%281%29-%3A-Proposition-de-Type-System#comment-form</comments>
      <wfw:comment>http://www.fabienpoulard.info/dotclear.php?post/2009/11/06/UIMA-Wikipedia-%281%29-%3A-Proposition-de-Type-System#comment-form</wfw:comment>
      <wfw:commentRss>http://www.fabienpoulard.info/dotclear.php?feed/atom/comments/68</wfw:commentRss>
      </item>
    
</channel>
</rss>