PDA

View Full Version : non-Unicode Hebrew to Unicode & removing vowel points



Martinzh
06-13-2013, 11:05 PM
I wonder is there any good way to convert non-Unicode Hebrew (Bwhebb) to Unicode (such as SBL Hebrew and Ezra SIL) font?
I tried the macro I found in the help document, but it has problems.

Take Gen 6:5 for example,
1117

After the conversion (I choose Ezra SIL in this case):
1118

I don't know what is the problem.

I use Microsoft Word 2010.

The code is attached below.

My second question is: How to remove all the vowels in this document? (I don't even care whether the vowels are correct or not. My purpose is to convert all the Hebrew words to Unicode and then remove all the vowels.)

Thank you very much!


Macro:

Sub ConvertAllBwHeb2Unicode()
ConvertBwHeb2Unicode "bwhebb", "Ezra SIL", True
End Sub




Sub ConvertBwHeb2Unicode(fromfont$, tofont$, doentirefile)


Dim o As Object


Dim ucstr As Variant


ReDim ucstr(1024) As Long


If (doentirefile = True) Then Selection.HomeKey Unit:=wdStory


Set o = CreateObject("bibleworks.automation")


Application.ScreenUpdating = True


icheck = 0


While (icheck = 0)


Selection.Find.ClearFormatting


With Selection.Find


.Font.Name = fromfont$


.Text = ""


.Replacement.Text = ""


.Forward = True


.Wrap = wdFindStop


.Format = True


.MatchCase = False


.MatchWholeWord = False


.MatchKashida = False


.MatchDiacritics = False


.MatchAlefHamza = False


.MatchControl = False


.MatchByte = False


.CorrectHangulEndings = False


.MatchAllWordForms = False


.MatchSoundsLike = False


.MatchWildcards = False


.MatchFuzzy = False


End With


If (Selection.Find.Execute = False) Then


icheck = 1


Else


istart = 1


iend = Selection.Characters.Count


ReDim ucstr(3 * iend + 2) As Long


ucstr(1) = iend


For i = istart To iend


ucstr(i + 1) = Asc(Selection.Characters(i))


Next i


o.BwHebb2Unicode ucstr


Rem Selection.Delete


Application.Keyboard (1037)


With Selection.Font


.NameFarEast = "SimSun"


.NameAscii = "Arial"


.NameOther = "Arial"


.Name = "Arial"


.Size = 10


.Bold = False


.Italic = False


.Underline = wdUnderlineNone


.UnderlineColor = wdColorAutomatic


.StrikeThrough = False


.DoubleStrikeThrough = False


.Outline = False


.Emboss = False


.Shadow = False


.Hidden = False


.SmallCaps = False


.AllCaps = False


.Color = wdColorAutomatic


.Engrave = False


.Superscript = False


.Subscript = False


.Spacing = 0


.Scaling = 100


.Position = 0


.Kerning = 0


.Animation = wdAnimationNone


.DisableCharacterSpaceGrid = False


.EmphasisMark = wdEmphasisMarkNone


.SizeBi = 14


.NameBi = tofont$


.BoldBi = False


.ItalicBi = False


End With


For i = 1 To ucstr(1)


s$ = ChrW(ucstr(i + 1))


Selection.TypeText Text:=s$


Next i


Application.Keyboard (1033)


End If


If (doentirefile = False) Then icheck = 1


Wend


Application.ScreenUpdating = True


Set bwutil = Nothing


End Sub

Michael Hanel
06-13-2013, 11:53 PM
I wonder is there any good way to convert non-Unicode Hebrew (Bwhebb) to Unicode (such as SBL Hebrew and Ezra SIL) font?
I tried the macro I found in the help document, but it has problems.



What version of BibleWorks are you using? In most recent BibleWorks versions (I think from 7 on) you can copy the text from BibleWorks straight into Unicode without having to do any converting yourself. If you specifically want the text without any vowel points, load WTT in the browse window, click your mouse in the browse window and hit the letter "x" on your keyboard to toggle vowel points off and then copy your text.

Martinzh
06-14-2013, 12:10 AM
What version of BibleWorks are you using? In most recent BibleWorks versions (I think from 7 on) you can copy the text from BibleWorks straight into Unicode without having to do any converting yourself. If you specifically want the text without any vowel points, load WTT in the browse window, click your mouse in the browse window and hit the letter "x" on your keyboard to toggle vowel points off and then copy your text.

Thank you, Michael.
I'm using v. 9.0.
I don't have any problem with this.
I'm editing a document from my professor, who used Bwhebb font to write a book, with the vowels.
Now the publisher requires to use Unicode fonts for Hebrew without vowel points.

I don't want to do it manually, cause it takes too much time.
Therefore I wonder if there is a good way to accomplish this purpose.

Thank you.

Glenn Weaver
06-14-2013, 08:39 AM
I suggest first using search & replace to remove all the vowel points. Once the vowel points are removed, then try the Word macro once again. That may accomplish what you want.

Glenn

Martinzh
06-14-2013, 10:48 AM
I suggest first using search & replace to remove all the vowel points. Once the vowel points are removed, then try the Word macro once again. That may accomplish what you want.

Glenn

Hi Glenn,

That sounds a good idea.
I don't know how to remove all the vowel points with search&replace.
Jim Darlack showed me to do it by removing one vowel or accent at a time. Is there any efficient way of doing this?
I'm not familiar with the codes. It is very easy to make mistakes.

Thanks a lot!

Glenn Weaver
06-14-2013, 12:01 PM
Hi Martinzh,

Without going into writing macro code to replace character numbers, the best way to do it is to search and replace each vowel point individually. It will be tedious, but other than replacing the text manually, this will be the best way to do it.

I hope that your professor will be paying you to do this work. This is not the type of work to be doing gratis, especially for an entire book.

Glenn

SkipB
06-14-2013, 01:52 PM
Depending on how many passages involved, it might be easier to set the export font to Ezra SIL turn off vowels in the browse window, then highlight and copy or use popup copy window to place a new version of the text in the manuscript and then delete the pointed text.

Martinzh
06-14-2013, 02:52 PM
Hi Martinzh,

Without going into writing macro code to replace character numbers, the best way to do it is to search and replace each vowel point individually. It will be tedious, but other than replacing the text manually, this will be the best way to do it.

I hope that your professor will be paying you to do this work. This is not the type of work to be doing gratis, especially for an entire book.

Glenn

Thanks, Glenn.
Yes.
I got stipend from my school. So it is no much difference with me. But I want to do it more efficiently if I could.

Martinzh
06-14-2013, 02:54 PM
Depending on how many passages involved, it might be easier to set the export font to Ezra SIL turn off vowels in the browse window, then highlight and copy or use popup copy window to place a new version of the text in the manuscript and then delete the pointed text.

Hi, thank you for your suggestion.
Can you explain more about how to do it?
Sorry, I'm not familiar with this area at all.

SkipB
06-15-2013, 11:28 AM
First in BW works place the cursor in the browse window and press<x> (just the letter, not brackets).
In your document, at the position you want to copy to, press <control><shift><b>. This will open your pop up copy window.
You will need to configure your format the first time so when the window opens left click Favorites. Select "configure copy popup favorites" from the bottom of the drop down menu.
This will open the "BW Options Window" with verse list or range selected.
Make sure that Export Unicode Hebrew is checked. Select Where to copy the verse list with the radio buttons.
Next in the list at the left select Fonts under the general heading, now select the appropriate Unicode Hebrew font and size. Click OK and it will take you back to the popup. Enter the verse range you want to copy and it will insert it in you document.
Check you have a copy of the original in your document except no accents or vowels then delete pointed text.

I hope that is clear enough.

Martinzh
06-16-2013, 12:52 PM
Thank you very much!
It is a little bit different from what you have described. I guess because you use an old version of BW? (Mine is BW 9.0. It is Unicode already, therefore I think there is no need to choose a Unicode font as such. But it would be helpful to help my professor. Thank you.)
However, I was able to insert a verse into the Word. I learned a new skill. Thank you very much!

If I did it rightly, it seems that I can only insert a version to the Word. It is not changing the words in the word document to Unicode. Therefore, in most cases, where they were only word(s), phrase(s) rather than a verse, this function does not help much.



First in BW works place the cursor in the browse window and press<x> (just the letter, not brackets).
In your document, at the position you want to copy to, press <control><shift><b>. This will open your pop up copy window.
You will need to configure your format the first time so when the window opens left click Favorites. Select "configure copy popup favorites" from the bottom of the drop down menu.
This will open the "BW Options Window" with verse list or range selected.
Make sure that Export Unicode Hebrew is checked. Select Where to copy the verse list with the radio buttons.
Next in the list at the left select Fonts under the general heading, now select the appropriate Unicode Hebrew font and size. Click OK and it will take you back to the popup. Enter the verse range you want to copy and it will insert it in you document.
Check you have a copy of the original in your document except no accents or vowels then delete pointed text.

I hope that is clear enough.

SkipB
06-17-2013, 08:46 AM
In my previous post, I had mentioned that you had the choice of the popup copy window or highligting and copying from the browse window. For words or parts of a verse that is how you would do it. With a selection highlighted right click on it and choose "copy selected text" choose from the sub menu "configure copy favorites." Then set up the options for browse window as you did for the copy verse list options. Setting the font to unicode and making sure export in unicode is selected so you have control of the font and size as it is pasted. And it gives you the option to paste non unicode fonts if a publisher requires that.
Unicode may be the default version 9 does have the flexibility to control what is copied and how.

SkipB
06-17-2013, 12:57 PM
In my first response I tried to indicate that (depending on how much you need to change) it might be easier to simply replace the old words with new un-pointed words. This involves as I said copying and deleting. You should know your own working style and be able to assess if searching and deleting individual vowels is faster than copying and pasting blocks.

For me, I found that copying and pasting the text without vowel points and deleting the previous pointed text was faster than going through and deleting vowels individually. Especially since sometimes deleting a vowel can have strange effects in a word processor.

For portions that require a whole verse or even a significant part of the verse the pop up window is fastest. Just delete the portion of a verse that is not needed.

For one or more words that do not form a significant portion of a verse copying and pasting from the browse window is probably best. The real power and flexibility of BibleWorks ability to copy and paste in one or more versions is harnessed from the BW Options Window.

Martinzh
06-17-2013, 03:18 PM
Thank you very much. Now I fully understand what you mean.

I thought that you were talking about automatic replacement.
Yes. I have gone through manually. And it took me less time than I already spent on figuring out how to do it automatically...

I just check my professor's BW version. It is BW 5.0...
I strongly recommended to purchase BW 9.0.
hehe...:)