% This is a TeX code to test if french words are well hyphenated
% tstcoup.tex               Copyright GUTenberg-Bernard Gaulle as in french.doc
%
% This code was developped with/for MlTeX V2 and/or (Ml)TeX V3    --bg 03/27/92
% with CMR or DC fonts (but don't use it with TeX V2)
%                                                            last mods 12/06/94
%
%%
%%      checksum        = "37383 104 306 4172"
%%
% Here are included LaTeX compatible definitions.               
%\scrollmode
\catcode`@=11
\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}% not an outer def
\gdef\newread{\alloc@6\read\chardef\sixt@@n}% not an outer def
\newwrite\@unused%..............................................\@unused
\long\gdef\@ifundefined#1#2#3{\expandafter\ifx\csname%......... \@ifundefined 
  #1\endcsname\relax#2\else#3\fi}
\ifx\protect\undefined\let\protect\relax\fi%....................\protect
\@ifundefined{typeout}{%........................................\typeout
  \global\newlinechar`\^^J%
  \gdef\typeout#1{{\let\protect\string\immediate\write\@unused{#1}}}%
                      }{}%
\typeout{^^J Test de validite des cesures sur le jeu de plus de 500 mots}
%
% creation fichier .idx
%
\newwrite\@mainidx
\immediate\openout\@mainidx\jobname.idx %
\begingroup%[[
\catcode`\]=13\def]{}
\let\bidon\relax
\catcode`,=\active
\def,{^^J}%
\def\DmyDeF#1{\immediate\write\@mainidx{#1}}%
%[
\def\Dmydef#1,#2]{\DmyDeF#1%[
                  \def\temp{#2}\ifx\temp\empty\let\Dmydef\relax\fi%
                  \Dmydef#2]}%
\def\dummydef[{\Dmydef}%]
\expandafter\def\csname OT\string 1\string\oe\endcsname% for 2e
                     {\string\oe\space\string{\string}}% for 2e
% Here are all the 499 french dictionary names used by J. Desarmenien
% plus n other words that were inapropriately hyphenated in the past.
\edef\mots{\input TSIv5n4 %}
\dummydef[\mots,]
\endgroup
\closeout\@mainidx%
Jeu reduit : (voir page suivante)\vfill\eject
\input \jobname.idx\vfill\eject
%
% Relecture et comparaison
%
\newread\@lidx
\immediate\openin\@lidx \jobname.idx %
\newcount\NB\NB=0
\catcode`[=\active\catcode`-=\active\def-{\string-}%]
\def\@MSG#1#2{\typeout{^^J /\the\NB/ Le mot #1 (\site)
                           devrait etre coupe #2\space!}}
\def\ATsite#1#2/{\edef\site{#2}%
                 \def-{}\xdef\ENTIER{#2}\def-{\string-}%
                 \immediate\read\@lidx to\Mustbe%
    \def\Tobe##1 /{\edef\mustbe{##1}}\expandafter\Tobe\Mustbe /%
    \ifx \site \mustbe \else\def-{\string-}\global\advance\NB by 1
             \bgroup\def\accent ##1 ##2{##2}\@MSG{.\ENTIER.}{.\mustbe.}\egroup
                            \fi\let\hbox\hboxDUM}
%
% A adapter eventuellement a votre site :
          \long\def[]    []#1 \par{\ATsite#1/}   % for TeX V3 
\ifx\lefthyphenmin\undefined
          \long\def[]      #1 \par{\ATsite#1/}\fi% for TeX V2
\ifx\starthyph\undefined
    \else \long\def[]      #1 \par{\ATsite#1/}\fi% for MlTeX V2
\ifx\undefined\new@fontshape\else% 
          \long\def\ATsitE#1 #2/{\ATsite{}#2/}
          \long\def[]#1/10 #2 \par{\ATsitE#2/}\fi% for NFSS
\ifx\documentclass\undefined\else% for LaTeX2e
          \long\def\ATsitE#1/{\ATsite{}#1/%
           \long\def\ATsitE##1 ##2/{\ATsite{}##2/}}%
          \long\def[]#1/10 #2 \par{\ATsite{}#2/}% 
          \let\mathbf\relax\let\mathsf\relax% 
          \let\mathtt\relax\let\mathit\relax% 
          \let\lgroup\relax\let\rgroup\relax\let\bracevert\relax%
          \fi%
%
\catcode`&=\active\def&{}\catcode`(=1\catcode`)=2
\let\hboxORI\hbox
\def\hboxDUM#1[]{\let\hbox\hboxORI}
%%%%%%%%%% 7bits defs %%%%%%%%%%%%%%%%%
\catcode`\^^?=\active\global\def^^?{\"}
\catcode`\^^S=\active\global\def^^S{\'}
\catcode`\^^R=\active\global\def^^R{\`}
\catcode`\^^P=\active\global\def^^P{\i}
\catcode`\^^[=\active\global\def^^[{\oe{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input myhyph.log }% log previously produced
\typeout{^^J             ******************}
\typeout{^^J F I N\space\space du\space\space T E S T}
\typeout{^^J (\the\NB\space mots en erreur)}
\typeout{^^J             ******************}
\typeout{^^J }
\bye
\endinput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
