From dcabd2bef1d68c80e2b84716855443cb58ae5ee3 Mon Sep 17 00:00:00 2001 From: Ben Linskey Date: Mon, 16 Dec 2013 22:47:01 -0500 Subject: Transcode entry key attribute value. The value of the 'key' attribute of the 'entry' element, which is used to create the lexicon entry heading, is now converted from Beta Code to Greek. --- src/com/benlinskey/grdbc/LexiconParser.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/com/benlinskey/grdbc/LexiconParser.java') diff --git a/src/com/benlinskey/grdbc/LexiconParser.java b/src/com/benlinskey/grdbc/LexiconParser.java index af16c51..a8c9e42 100644 --- a/src/com/benlinskey/grdbc/LexiconParser.java +++ b/src/com/benlinskey/grdbc/LexiconParser.java @@ -100,9 +100,22 @@ public class LexiconParser extends GreekTextParser { * characters */ public String getEntry() { + transcodeEntryKey(); transcodeInElements("orth"); transcodeInElements("ref"); transcodeInElements("foreign"); return getUpdatedXML(); } + + /** + * Converts the value of the entry element's "key" attribtute from Beta + * Code to Greek. + */ + private void transcodeEntryKey() { + Node entryNode = doc.getElementsByTagName("entry").item(0); + Node keyAttr = entryNode.getAttributes().getNamedItem("key"); + String beta = keyAttr.getTextContent(); + String greek = betaToGreek(beta); + keyAttr.setTextContent(greek); + } } -- cgit v1.2.3