Terminology maint. in Word97 
Author Message
 Terminology maint. in Word97

Hi!

I need some help in improving the macro I did in Word.

I'm a translator, and I need a way to maintain terminology on
translation projects involving more than one translator. That means
that I need a way of distributing a glossary of English-Croatian terms
that other translators should adhere to, but also a way for other
translators to add new terms to this glossary/dictionary which I
should then check, reject, or approve...

I've done a kind of "terminology maintenance" macro in Word 95, using
sequential file ("dictionary") access, but it wasn't very usable,
since my "dictionary" has more than 4,500 terms. And sequential file
access in Word 95 was very slow in accessing the terms from the end of
the dictionary file.

The dictionary is kept in a sequential file, with simple structure,
like this:

English term, Croatian term
English term, Croatian term
English term, Croatian term
English term, Croatian term
 ... etc...

In Word 95 it was slow, but I've tried it in Word 97 a few days ago,
and, to my surprise, it's fasssst!!!!!

Anyway, here's the macro as it looks like in Word 97:

------------- 8< cut here 8< -----------------

Option Compare Text
Public Sub MAIN()
Dim orig$
Dim porig$
porig$ = Space(255)
Dim pprev$
Dim n As Long
pprev$ = Space(255)
On Error GoTo -1: On Error GoTo finish

'if there is a selection
If WordBasic.SelType() = 2 Then
    GoTo ima
Else
'if there's no selection, show a dialog box
    GoTo nema
End If

ima:
'copies the selected (marked) text
orig$ = WordBasic.[RTrim$](WordBasic.[GetBookmark$]("\Sel")): WordBasic.EditCopy
' orig$ = selected text, i.e. English word we want to find translation for
GoTo Dalje

nema:
' displays a dialog box for entry of English term we
' want translation for
for
WordBasic.BeginDialog 306, 98, "Custom Dictionary"
    WordBasic.Text 10, 6, 271, 13, "Enter the word you want:", "Text1"
    WordBasic.TextBox 11, 28, 286, 18, "TextBox1"
    WordBasic.OKButton 55, 63, 88, 21
    WordBasic.CancelButton 181, 63, 88, 21
WordBasic.EndDialog

Dim dlg As Object: Set dlg = WordBasic.CurValues.UserDialog
WordBasic.Dialog.UserDialog dlg
orig$ = WordBasic.[RTrim$](dlg.TextBox1)
' orig$ = entered text, i.e. English word we want to find translation for

Dalje:

Open "D:\winword\rjecnik.dic" For Input As 1
' this is the seq. file with the "dictionary", structured
' as indicated above

Input #1, porig$, pprev$
' porig$ = English text; pprev$ = Croatian text (translation)

While porig$ <> orig$
    If EOF(1) Then
        WordBasic.MsgBox Chr(34) + orig$ + Chr(34) + " not found."
        GoTo finish
    End If
    n = Seek(1) - 1
    Input #1, porig$, pprev$
Wend

'  here I should put the stuff to do if there's no *exact* match
'  i.e. find the terms that have the same root,
'  like "tool" in "toolbar", which would give me, for example,
'  "tools", "toolbox" and "tool tip" in a list box which should
'  be presented to user

WordBasic.Insert pprev$
' inserts the Croatian translation, if exact term is found

finish:
Close 1
'closes the seq. file (i.e. the "dictionary")

End Sub

-------------- 8< cut here 8< ------------

As shown above, if there's no *exact* match on English text, I'd like
to add a dialog box showing the terms with the same root; i.e. if I'm
looking for "toolbar", and it does not exist in the file, I'd get
"tool", "toolbox" or "tool tip", which *are* in the dictionary - in a
list box or something...

Any ideas?

Anyway, that's about it.

Unless you have any other ideas for improvements.. ;-)

Thanks,

Denis

---------------------------------------------------------------------

--------------------------------------------------------------------+
Denis Pleic      | Phone: (+385) 42 230-751 | Fax: (+385) 42 231 598
Vodnikova 15     | WWW pages ---------------------------------------+
HR-42000 Varazdin| http://www.*-*-*.com/ ~dpleic/
 CROATIA         | http://www.*-*-*.com/



Thu, 30 Mar 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Help with Look-up Table - Maint.mdb (0/1)

2. Help with Look-up Table - Maint.mdb (1/1)

3. Using the Custom Maint Wizard / Installer

4. Access97 Maint Pages via non-ActiveX Clients

5. #HELP ON BACK_END MAINT.

6. Terminology

7. Terminology and a calendar problem.

8. Terminology help please!

9. OLE terminology

10. Help with a terminology


 
Powered by phpBB® Forum Software © phpBB Group