Using diff in Hebrew

Viewed 65

I am new to diff. I have used it in the past. But I want to know, can one use diff to track differences between two files in Hebrew? I am wanting to compare Biblical Hebrew files that have vowel points and accents.

1 Answers

I am not aware of any "diff" (file comparison) tool that is capable of producing reasonable output when run on Biblical Hebrew.

What I would advise is to first transform the Biblical Hebrew into a representation that can be "diffed" and then run a "diff" program on it. This is what I have done when I have needed to do such a "diff."

For instance I transform the 1st 3 words of Genesis,

בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים

Into the following (one word per bulleted list item)

  • v,·,:,r,‥,α,$,·sh,i,[ti],y,τ
  • v,·,a,r,a,⅃,α
  • α,:∵,l,o,h,i,⅄,y,m.

My diffable-pointed-hebrew GitHub repo contains a Python program that performs such a transformation. It outputs a JSON file containing:

  • first, a table of metadata describing the transformation
  • then, a list of lines, where lines are lists of words, where words are strings that were separated by spaces in the input file.

See sample-input.txt & sample-output.json in that repo.

Related