Macro for phonetics insertions

R

Rhabdo Sidera

Hi, i was wondering if there is a way to auto-insert the phonetic equivalen
above every word in a document throught the facilitations of a macro?

In simple terms: find every word, insert a phonetic reference above word,
but in a different font. a word in the .doc is defined as anything between
two spaces.

I would also like to know if it is possible to search and replace within the
phonetic text alone...

thanx a million

keith
 
J

Jezebel

It's not impossible, but it would be very difficult ---

a) how do you determine the phonetic equivalent of a word?

b) there's no easy way to insert 'alternative' text like that. You could use
textboxes, but you'd need one for each word, and you'd have to re-position
the lot every time any of your basic text moved.

Yes, you can search and replace within phonetic text -- phonetic text
comprises characters like any other.
 
H

Helmut Weber

Hi Keitho,

at first see:
http://en.wikipedia.org/wiki/Phonetic_transcription
Hi, i was wondering if there is a way to auto-insert the phonetic equivalent
above every word in a document throught the facilitations of a macro?

where do you want to get the phonetic transcription from?
In simple terms: find every word, insert a phonetic reference above word,
but in a different font.

The phonetic transcription will be in most cases either longer
or shorter as the corresponding piece of text in ordinary English.
So it will all and up in a mess, probably
a word in the .doc is defined as anything between two spaces.
And between the start of the doc and the first space.
And between the start of the doc and the next paragraph mark,
if there is no space in the first paragraph.
And between a paragraph mark and the first space
in the next paragraph.
And between a paragraph mark and the next paragraph mark,
if there is no space in the paragraph
And between a space and the end of a paragraph.

Given there is no punctuation at all.
I would also like to know if it is possible to search and replace within the
phonetic text alone...

Seems all in all not practical to me.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
K

Klaus Linke

b) there's no easy way to insert 'alternative' text like that.

For the placement, you could use Ruby text. It's a bit messy though ... all
the text will be in EQ fields.
You find it on the "Extended formatting" toolbar, or you can add the command
FormatPhoneticGuide to some toolbar.

If you find some way to get the phonetics text, you could try to insert the
proper fields yourself in a macro... once you've figured out the proper
field switches, font sizes... from some samples you've inserted via the
command.

Regards,
Klaus
 
R

Rhabdo Sidera

Jezebel said:
It's not impossible, but it would be very difficult ---

a) how do you determine the phonetic equivalent of a word?

b) there's no easy way to insert 'alternative' text like that. You could use
textboxes, but you'd need one for each word, and you'd have to re-position
the lot every time any of your basic text moved.

Yes, you can search and replace within phonetic text -- phonetic text
comprises characters like any other.

Apparently Word 2003 does it all. That is, insert and position the
replacement,
but it is all manual. The .doc I'm dealing with is in 1st century Koine
Greek and has 600 000+ words... Hence i need a macro. lol

If I can find a macro that simply, copies each word and then replaces it (as
is) in the EQ field, with the only change being the font... that would be a
good first step...

My seconds step was going to be searching ONLY within phonetic part of the
field and replacing the letters that would give a closer to accurate phonetic
expression of the Koine Grecian Word.

But I'll have another go, see what gives...
 
R

Rhabdo Sidera

Thanks for the reply, that was encouraging...

How about... a macro that finds and inserts the 'find what text' within the
phonetic field and above the original word?

Jez, if that can be easily accomplished than I may be able to use a 'find
replace' macro to search ONLY within the phonetic text field and replace the
necessary letters.
 
R

Rhabdo Sidera

Hi Klaus, thanks for the reply,,,,,

Is there a macro to find and replace any all words of the text with the
'find what text' above the original in the phonetic field...

Because if there is... surely one could use another macro to search within
the phonetic field and change the letters that need to be changed.

Mate, if there is such a macro, please let me have it... you'll live in my
prayer forever... lol

thanks for the reply you've been so encouraging in what is a daunting task...

By the way, I am using phonetic thingee in word 2003 found under the
extended formatting... but it is way too slow... one word at a time... 600
000 to go...


thanks again
 
C

Charles Kenyon

In English, what is the phonetic for the letters "gh" or "oe?" English is
not a phonetic language.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide




--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
R

Rhabdo Sidera

Hi Charles,

I guess you're an expert on phonetics, forget English and try some first
century Koine Greek instead. All be it, the language is dead, no one agrees
how it was or is pronounced, and the authors I'm transcribing spoke with an
accent outside of the parochial Hellenist vernacular (of which their were
many), and were themselves expressing eastern thought in an intrinsically
western language...

Now that you have that on for size, please tell me (if you can) how to
auto-copy .6 of a million words into the phonetic field in word 2003... I'm
an idiot in these matters and manifestly so with anything that pushes the
boundaries beyond search and replace... A suggestion for a macro that could
accomplish the task would be excellent...

Thanks again.
 
K

Klaus Linke

I've done something like this for Russian text ... added a simplified Latin
transliteration.

But I didn't use EQ fields, because it would have been too difficult to
maintain. Instead I inserted the transliteration in [braces] after the
cyrillic text.
Would that be a possibility?

Basically I first made sure that the cyrillic text was in some character
style, then the macro searched for that character style, read the text
(strCyr = Selection.Text), calculated the transliteration, and inserted it
(Selection.InsertAfter Translit(strCyr)).

For the Russian transliteration, the algorithm was rather complicated.
But in your case, it might be quite simple...

Function Translit(strO As String) As String
Dim strTranslit As String
Dim pos as Long
strO = Trim(strO)
strTranslit=strO

For pos = 1 To Len(strO)
Select Case Mid(strO, pos, 1)
Case ChrW(&HXXX)
Mid(strTranslit, pos, 1) = ChrW(&HYYY)
' ...
Next pos

strTranslit= " [" & strTranslit & "]"
Translit=strTranslit
End Function

You'd just need to implement the list of substitutions you want to make --
ChrW(&HXXX) turns into ChrW(&HYYY).

Greetings,
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top