15.07.2013 Views

Microsoft Visual Basic - Encyclopaedia Gentium Boni

Microsoft Visual Basic - Encyclopaedia Gentium Boni

Microsoft Visual Basic - Encyclopaedia Gentium Boni

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

fctAutomatosWH - 1<br />

Public Function AutomatosWH(mot)<br />

If mot = "" Then Exit Function<br />

Dim ofile$<br />

Dim lfile%<br />

Dim ligne$<br />

nveaumot = mot<br />

'If Right(mot, 1) = "j" Then mot = Mid(mot, 1, Len(mot) - 1) + "v"<br />

'mot = Replace(mot, "x", "c")<br />

'mot = Replace(mot, "q", "y")<br />

ofile = App.Path & "\tools\corrwh.txt"<br />

lfile = FreeFile<br />

mot = Replace(mot, "V ", "n ")<br />

mot2 = Replace(mot, "y", "§")<br />

mot3 = Replace(mot, "q", "y")<br />

Open ofile For Input As #lfile<br />

Do<br />

Line Input #lfile, ligne<br />

ligne = Trim(ligne)<br />

If InStr(1, ligne, LCase(mot)) 0 Or _<br />

InStr(1, ligne, LCase(mot2)) 0 Or _<br />

InStr(1, ligne, LCase(mot3)) 0 Then<br />

repere1 = InStr(1, ligne, "{")<br />

strong = Mid(ligne, Len(mot) + 1, repere1)<br />

repere3 = InStr(1, strong, "{")<br />

strong = Mid(strong, 1, repere3 - 1)<br />

strong = Trim(strong)<br />

If Len(strong) = 9 Then<br />

strong = Mid(strong, 1, 4)<br />

ElseIf InStr(1, strong, " ") 0 Then<br />

strong = Mid(strong, 1, InStr(1, strong, " ") - 1)<br />

End If<br />

complement = Trim(Mid(ligne, Len(mot) + Len(strong) + 2, Len(ligne)))<br />

If InStr(1, complement, " ") 0 Then<br />

tempstrong = Mid(complement, 1, InStr(1, complement, " ") - 1)<br />

complement = Mid(complement, InStr(1, complement, " ") + 1, Len(complement))<br />

Exit Do<br />

End If<br />

End If<br />

Loop While Not EOF(lfile)<br />

lose<br />

strong = strong<br />

complement = complement<br />

A partir du mot initial, j'ai trouvé le numéro strong<br />

je cherche donc ce qu'il signifie<br />

et je le mets toute la définition dans temp2<br />

f strong "" Then<br />

mot = strong<br />

Call LireStrongFrN(strong)<br />

nd If<br />

--------------------------------------------<br />

maintenant je lis temp2, et je regarde comment le mot a été traduit par Louis Segond<br />

file = App.Path & "\tools\temp2.txt"<br />

file = FreeFile<br />

Open ofile For Input As #lfile<br />

Do

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!