diff --git a/tipe.ml b/tipe.ml index 06295bb..c9fffa6 100644 --- a/tipe.ml +++ b/tipe.ml @@ -236,127 +236,8 @@ let getMajChar chr = let ct = getCharType chr in match ct with | Min -> Char.chr ((Char.code chr)-32) | _ -> chr;; - -(*** -(* Renvoie les caractères lc et rc de types respectifs lt et rt formatés pret au rajout *) -(* La nouvelle chaine concaténée est prete pour un nouveau mot.*) -let ajoutSchar ch lt lc rt rc = - match (lt,rt) with - | SE,_ -;; -***) -(*** -let getMotsFromLine str = let mots=ref [] - and lmot = ref "" - and maj = ref false (* Tout est-il en majuscules *) - and majed = ref false (* La premiere lettre est-elle en majuscule *) - and inMot = ref false - and spaceBefore = ref false - and spaceRequested = ref false - and lc = nullchar - and i = ref 0 in -while !i < (String.length str) do - if !spaceRequested && getCharType.str[i] <> CW - then begin - (* Si on a demandé un espace et qu'il n'y en a pas *) - (* Du coup on écris le caractère avec NOSPACE avant de continuer au traitement normal. *) - (* Le cas ou la requete est satisfaite est dans le match ci-dessous *) - (* Ben je ne suis pas un espace, alors bon ? on force avec NOSPACE*) - inMot := false; - mots := (String.make 1 !lc)::(ctrl "NOSPACE")::!mots; - lmot := ""; - spaceBefore := false; - spaceRequested := false (* Ben plus maintenant du coup *) - end; - - match getCharType str.[i] in - | SW -> (* Un espace en fait *) - if !inMot - then - inMot := false; - mots := !lmot::!mots; - lmot := ""; - spaceBefore := true - else - if !spaceRequested - then - mots := (String.make 1 !lc)::!mots; - spaceRequested := false - spaceBefore := true - inMot := false - else - ### - | SE -> - if !inMot - then - lc := str.[i]; - inMot := false - else - ### - | SA -> - if !inMot - then - lc := str.[i]; - inMot := false; - spaceRequested := true - else - ### - | SB -> - if !inMot - then - ### - else - if !spaceBefore - then - mots := (String.make 1 str.[i])::!mots; - spaceRequested := false; - spaceBefore := false; - inMot := false - else - ### - | CW -> - if !inMot - then - (* Terminer le mot prématurement et rajouter le mot du caractère CW en espérant un espace *) - inMot := false; - mots := !lmot::(ctrl "NOSPACE")::(String.make 1 str.[i])::!mots; - lmot := ""; - spaceBefore := false; - spaceRequested := true; - else - if !spaceBefore - then - (* OK pour l'instant, on prépare le caractère en espérant un espace*) - lc := str.[i]; - inMot := false; - spaceRequested := true - else - (* D'après le if préléminaire, on a spaceRequested=false *) - (* On a un CW avec une chaine qui devait etre finie *) - ### - | Maj,Min,Dig -> - if !inMot - then - spaceBefore := false; - lmot := !lmot^str.[i] - else - match !lc with - | SB | SE -> - mots := (String.make 1 !lc)::!mots; - lc := nullchar - spaceRequested := false - spaceBefore := false - inMot := true - | _ -> - ### - inMot := true - - ; - i := i+1 -done; -;;**) let finDeMot lst lmot majed fullmaj nospace = match (majed,fullmaj,nospace) with