Jump to content

Please read the Forum Rules before posting.

Photo
- - - - -

Is there a quick way to convert scriptures in roman numerals to regular numbers?


  • Please log in to reply
6 replies to this topic

#1 Josh H

Josh H

    Resource Builder

  • Members (T)
  • PipPipPipPip
  • 72 posts
  • LocationLancaster, Ca
Offline

Posted 07 June 2012 - 10:36 PM

Hi guys,

I'm working with a text that has tons of scripture references in roman numeral form (for example john iii.16). Is there a quick way to convert the roman numerals into regular numbers that can be tooltiped, or do i need to do each one manually? I don't think the tooltip tool recognizes Roman numerals...

Thanks,
Josh

#2 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,891 posts
  • LocationGallatin, TN
Offline

Posted 07 June 2012 - 11:24 PM

Select the document, or a portion. Click Edit in ToolTip NT. At the bottom of the menu, choose the Roman numeral type that matches your text. And the conversion happens!

#3 Josh H

Josh H

    Resource Builder

  • Members (T)
  • PipPipPipPip
  • 72 posts
  • LocationLancaster, Ca
Offline

Posted 07 June 2012 - 11:31 PM

Thanks a bunch...that's a relief, the thought of changing each verse one by one was giving me a headache!

#4 jonathon

jonathon

    e-Sword Fanatic

  • Contributors
  • PipPipPipPipPip
  • 753 posts
Offline

Posted 08 June 2012 - 08:58 AM

the thought of changing each verse one by one was giving me a headache!


It is pretty easy to whip up a python script that converts Roman numerals to Arabic numberals.

def RomanNumeralsToDecimal(roman_string):
   import string
   check_point = exclude_non_roman_numerals( roman_string )

#   print roman_string, " is being checked prior to RN2D"
#   print check_point, " is the value of check_point "

   if check_point > 0:
		num = 0
   elif check_point < -1 :
		num = 0
   else:
		temp_roman_string= string.upper(roman_string)
		exp = ""
		if iv.search(temp_roman_string) != None:  temp_roman_string= iv.sub("+4",   temp_roman_string)
		if ix.search(temp_roman_string) != None:  temp_roman_string= ix.sub("+9",   temp_roman_string)
		if xl.search(temp_roman_string) != None:  temp_roman_string= xl.sub("+40",  temp_roman_string)
		if xc.search(temp_roman_string) != None:  temp_roman_string= xc.sub("+90",  temp_roman_string)
		if cd.search(temp_roman_string) != None:  temp_roman_string= cd.sub("+400", temp_roman_string)
		if cm.search(temp_roman_string) != None:  temp_roman_string= cm.sub("+900", temp_roman_string)
		if  i.search(temp_roman_string) != None:  temp_roman_string=  i.sub("+1",   temp_roman_string)
		if  v.search(temp_roman_string) != None:  temp_roman_string=  v.sub("+5",   temp_roman_string)
		if  x.search(temp_roman_string) != None:  temp_roman_string=  x.sub("+10",  temp_roman_string)
		if  l.search(temp_roman_string) != None:  temp_roman_string=  l.sub("+50",  temp_roman_string)
		if  c.search(temp_roman_string) != None:  temp_roman_string=  c.sub("+100", temp_roman_string)
		if  d.search(temp_roman_string) != None:  temp_roman_string=  d.sub("+500", temp_roman_string)
		if  m.search(temp_roman_string) != None:  temp_roman_string=  m.sub("+1000", temp_roman_string)
		# The following were added in a futile attempt
		# to prevent crashes, when attempting to convert
		# non-roman numerals to latin numerals.
		if  a.search(temp_roman_string) != None:  temp_roman_string= a.sub("+0", temp_roman_string)
		if  b.search(temp_roman_string) != None:  temp_roman_string= b.sub("+0", temp_roman_string)
		if  e.search(temp_roman_string) != None:  temp_roman_string= e.sub("+0", temp_roman_string)
		if  f.search(temp_roman_string) != None:  temp_roman_string= f.sub("+0", temp_roman_string)
		if  g.search(temp_roman_string) != None:  temp_roman_string= g.sub("+0", temp_roman_string)
		if  j.search(temp_roman_string) != None:  temp_roman_string= j.sub("+0", temp_roman_string)
		if  k.search(temp_roman_string) != None:  temp_roman_string= k.sub("+0", temp_roman_string)
		if  n.search(temp_roman_string) != None:  temp_roman_string= n.sub("+0", temp_roman_string)
		if  o.search(temp_roman_string) != None:  temp_roman_string= o.sub("+0", temp_roman_string)
		if  p.search(temp_roman_string) != None:  temp_roman_string= p.sub("+0", temp_roman_string)
		if  q.search(temp_roman_string) != None:  temp_roman_string= q.sub("+0", temp_roman_string)
		if  r.search(temp_roman_string) != None:  temp_roman_string= r.sub("+0", temp_roman_string)
		if  s.search(temp_roman_string) != None:  temp_roman_string= s.sub("+0", temp_roman_string)
		if  t.search(temp_roman_string) != None:  temp_roman_string= t.sub("+0", temp_roman_string)
		if  u.search(temp_roman_string) != None:  temp_roman_string= u.sub("+0", temp_roman_string)
		if  w.search(temp_roman_string) != None:  temp_roman_string= w.sub("+0", temp_roman_string)
		if  h.search(temp_roman_string) != None:  temp_roman_string= h.sub("+0", temp_roman_string)
		if  y.search(temp_roman_string) != None:  temp_roman_string= y.sub("+0", temp_roman_string)
		if  z.search(temp_roman_string) != None:  temp_roman_string= z.sub("+0", temp_roman_string)
		exec "num = " + temp_roman_string
   return num


It usually is simpler to use the built in library.

jonathon

#5 jumson

jumson

    New to Bible Support

  • Veterans
  • Pip
  • 2 posts
Offline

Posted 01 December 2012 - 09:38 AM

I accidentally posted this in the review of the User Guide, so I'll repost my issue here:

A question regarding "Converting Roman Numerals to Digits"
It will not work for me.
Here is an example of my text: "Kiss the Son (Ps ii 12) and embrace the tenders of mercy; touch His sceptre and live; for why will ye die? I do not beg for myself, but would have you happy: this is the prize I run for. My soul's desire and prayer for you is, that you may be saved (Rom x 1)."
I highlight it, go to Edit-->Roman 3 (or 1 or 2) and nothing happens...am I doing it correctly?
Interesting stuff....http://knomyself.blogspot.com/

#6 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,891 posts
  • LocationGallatin, TN
Offline

Posted 01 December 2012 - 09:44 AM

T4 expects there to be punctuation between the roman numerals:

Ps ii. 12
Ps ii, 12
Ps ii: 12


#7 jumson

jumson

    New to Bible Support

  • Veterans
  • Pip
  • 2 posts
Offline

Posted 01 December 2012 - 10:49 AM

seems like I should have figured that out on my own...thanks...
Interesting stuff....http://knomyself.blogspot.com/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users




Similar Topics



Latest Blogs