| 291 | | root.setLabel("<span class=\"hebrew\">" + |
|---|
| 292 | | HebrewConverter.toHtml(hebrewText.toString()) + |
|---|
| 293 | | "</span>"); |
|---|
| 294 | | |
|---|
| 295 | | %><%= root.toHtml(rend) %><% |
|---|
| 296 | | } |
|---|
| 297 | | |
|---|
| 298 | | BookData swordVerse = null; |
|---|
| 299 | | try |
|---|
| 300 | | { |
|---|
| 301 | | swordVerse = KJV.getVerse(emdros, selBook, selChapNum, |
|---|
| 302 | | selVerseNum); |
|---|
| 303 | | %><p><em><%= |
|---|
| 304 | | OSISUtil.getCanonicalText(swordVerse.getOsisFragment()) |
|---|
| 305 | | %></em></p><% |
|---|
| 306 | | } |
|---|
| 307 | | catch (Exception e) |
|---|
| 308 | | { |
|---|
| 309 | | %><p>KJV Gloss not found (<%= e %>)</p><% |
|---|
| 310 | | } |
|---|
| 311 | | |
|---|
| | 284 | %> |
|---|
| | 285 | |
|---|
| | 286 | <span class="hebrew"><%= |
|---|
| | 287 | HebrewConverter.toHtml(hebrewText.toString()) |
|---|
| | 288 | %></span> |
|---|
| | 289 | |
|---|
| | 290 | <table> |
|---|
| | 291 | <% for (int row = 0; row < 2; row++) { %> |
|---|
| | 292 | <tr> |
|---|
| | 293 | <% |
|---|
| | 294 | for (Iterator<String[]> i = columns.iterator(); |
|---|
| | 295 | i.hasNext();) |
|---|
| | 296 | { |
|---|
| | 297 | %> |
|---|
| | 298 | <% String [] rows = i.next(); %> |
|---|
| | 299 | <td><%= rows[row] %></td> |
|---|
| | 300 | <% |
|---|
| | 301 | } |
|---|
| | 302 | %> |
|---|
| | 303 | </tr> |
|---|
| | 304 | <% } %> |
|---|
| | 305 | <tr> |
|---|
| | 306 | <td colspan="<%= columns.size() %>"><% |
|---|
| | 307 | try |
|---|
| | 308 | { |
|---|
| | 309 | swordVerse = KJV.getVerse(emdros, selBook, selChapNum, |
|---|
| | 310 | selVerseNum); |
|---|
| | 311 | %><em><%= |
|---|
| | 312 | OSISUtil.getCanonicalText(swordVerse.getOsisFragment()) |
|---|
| | 313 | %></em><% |
|---|
| | 314 | } |
|---|
| | 315 | catch (Exception e) |
|---|
| | 316 | { |
|---|
| | 317 | %>KJV Gloss not found (<%= e %>)<% |
|---|
| | 318 | } |
|---|
| | 319 | %></td> |
|---|
| | 320 | </tr> |
|---|
| | 321 | </table> |
|---|
| | 322 | <% |
|---|
| | 323 | } |
|---|
| | 324 | |
|---|
| 544 | | // wordnet gloss |
|---|
| 545 | | { |
|---|
| 546 | | String wordnetGloss = word |
|---|
| 547 | | .getEMdFValue("wordnet_gloss") |
|---|
| 548 | | .getString(); |
|---|
| 549 | | Long wordnetSynset = new Long(word |
|---|
| 550 | | .getEMdFValue("wordnet_synset") |
|---|
| 551 | | .getInt()); |
|---|
| 552 | | |
|---|
| 553 | | if (wordnetGloss == null || |
|---|
| 554 | | wordnetGloss.equals("")) |
|---|
| 555 | | { |
|---|
| 556 | | OntologyDb.OntologyEntry entry = |
|---|
| 557 | | ontology.getWordByLexeme( |
|---|
| 558 | | word.getEMdFValue("lexeme") |
|---|
| 559 | | .getString()); |
|---|
| 560 | | if (entry != null) |
|---|
| 561 | | { |
|---|
| 562 | | wordnetGloss = entry.m_EnglishGloss; |
|---|
| 563 | | } |
|---|
| 564 | | else |
|---|
| 565 | | { |
|---|
| 566 | | wordnetGloss = null; |
|---|
| 567 | | } |
|---|
| 568 | | |
|---|
| 569 | | if (entry != null && |
|---|
| 570 | | wordnetSynset.longValue() == 0) |
|---|
| 571 | | { |
|---|
| 572 | | wordnetSynset = entry.m_Synset; |
|---|
| 573 | | } |
|---|
| 574 | | } |
|---|
| 575 | | |
|---|
| 576 | | if (ewngId == wid && |
|---|
| 577 | | request.getParameter("ewngs") != null) |
|---|
| 578 | | { |
|---|
| 579 | | wordnetGloss = request.getParameter("gloss"); |
|---|
| 580 | | Change ch = emdros.createChange( |
|---|
| 581 | | EmdrosChange.UPDATE, |
|---|
| 582 | | "word", new int[] {wid}); |
|---|
| 583 | | ch.setString("wordnet_gloss", wordnetGloss); |
|---|
| 584 | | ch.execute(); |
|---|
| 585 | | ewngId = -1; |
|---|
| 586 | | } |
|---|
| 587 | | |
|---|
| 588 | | POS wordnetPos = null; |
|---|
| 589 | | |
|---|
| 590 | | if (part_of_speech.equals("verb")) |
|---|
| 591 | | { |
|---|
| 592 | | wordnetPos = POS.VERB; |
|---|
| 593 | | } |
|---|
| 594 | | else if (part_of_speech.equals("noun")) |
|---|
| 595 | | { |
|---|
| 596 | | wordnetPos = POS.NOUN; |
|---|
| 597 | | } |
|---|
| 598 | | else if (part_of_speech.equals("adjective")) |
|---|
| 599 | | { |
|---|
| 600 | | wordnetPos = POS.ADJECTIVE; |
|---|
| 601 | | } |
|---|
| 602 | | else if (part_of_speech.equals("adverb")) |
|---|
| 603 | | { |
|---|
| 604 | | wordnetPos = POS.ADVERB; |
|---|
| 605 | | } |
|---|
| 606 | | |
|---|
| 607 | | Synset [] senses = null; |
|---|
| 608 | | if (wordnetPos != null && wordnetGloss != null) |
|---|
| 609 | | { |
|---|
| 610 | | senses = wordnet.getSenses(wordnetPos, |
|---|
| 611 | | wordnetGloss); |
|---|
| 612 | | } |
|---|
| 613 | | |
|---|
| 614 | | Cell wordnetCell = new Cell(); |
|---|
| 615 | | cell.subcells.add(wordnetCell); |
|---|
| 616 | | |
|---|
| 617 | | if (wordnetPos == null) |
|---|
| 618 | | { |
|---|
| 619 | | wordnetCell.html = ""; |
|---|
| 620 | | } |
|---|
| 621 | | else if (ewngId == wid && canWriteToWord) |
|---|
| 622 | | { |
|---|
| 623 | | if (wordnetGloss == null) |
|---|
| 624 | | { |
|---|
| 625 | | wordnetGloss = ""; |
|---|
| 626 | | } |
|---|
| 627 | | |
|---|
| 628 | | wordnetCell.html = "<form method=\"post\">\n" + |
|---|
| 629 | | "<input type=\"hidden\" name=\"ewng\"" + |
|---|
| 630 | | " value=\"" + wid + "\">\n" + |
|---|
| 631 | | "<input name=\"gloss\" size=\"10\" value=\"" + |
|---|
| 632 | | wordnetGloss.replaceAll("<", "<") |
|---|
| 633 | | .replaceAll(">", ">") + |
|---|
| 634 | | "\">\n" + |
|---|
| 635 | | "<input type=\"submit\" name=\"ewngs\""+ |
|---|
| 636 | | " value=\"Save\">\n" + |
|---|
| 637 | | "</form>"; |
|---|
| 638 | | } |
|---|
| 639 | | else if (wordnetGloss == null) |
|---|
| 640 | | { |
|---|
| 641 | | wordnetCell.html = "[<a href=\"clause.jsp?" + |
|---|
| 642 | | "ewng=" + wid + "\">Add</a>]"; |
|---|
| 643 | | } |
|---|
| 644 | | else |
|---|
| 645 | | { |
|---|
| 646 | | wordnetCell.html = wordnetGloss + " ["; |
|---|
| 647 | | |
|---|
| 648 | | if (canWriteToWord) |
|---|
| 649 | | { |
|---|
| 650 | | wordnetCell.html += |
|---|
| 651 | | "<a href=\"clause.jsp?" + |
|---|
| 652 | | "ewng=" + wid + "\">edit</a>|"; |
|---|
| 653 | | } |
|---|
| 654 | | |
|---|
| 655 | | wordnetCell.html += "<a href=\"" + |
|---|
| 656 | | "http://www.wordreference.com/definition/" + |
|---|
| 657 | | URLEncoder.encode(wordnetGloss) + |
|---|
| 658 | | "\">lookup</a>]"; |
|---|
| 659 | | } |
|---|
| 660 | | |
|---|
| 661 | | if (swnsId == wid && |
|---|
| 662 | | request.getParameter("swnss") != null) |
|---|
| 663 | | { |
|---|
| 664 | | wordnetSynset = new Long( |
|---|
| 665 | | request.getParameter("wns")); |
|---|
| 666 | | Change ch = emdros.createChange( |
|---|
| 667 | | EmdrosChange.UPDATE, |
|---|
| 668 | | "word", new int[] {wid}); |
|---|
| 669 | | ch.setInt("wordnet_synset", |
|---|
| 670 | | wordnetSynset.longValue()); |
|---|
| 671 | | ch.execute(); |
|---|
| 672 | | swnsId = -1; |
|---|
| 673 | | } |
|---|
| 674 | | |
|---|
| 675 | | Cell glossCell = new Cell(); |
|---|
| 676 | | cell.subcells.add(glossCell); |
|---|
| 677 | | |
|---|
| 678 | | if (wordnetPos == null) |
|---|
| 679 | | { |
|---|
| 680 | | glossCell.html = ""; |
|---|
| 681 | | } |
|---|
| 682 | | else if (wordnetGloss == null) |
|---|
| 683 | | { |
|---|
| 684 | | glossCell.html = "(no word to look up in Wordnet)"; |
|---|
| 685 | | } |
|---|
| 686 | | else if (senses == null) |
|---|
| 687 | | { |
|---|
| 688 | | glossCell.html = "(no match in Wordnet)"; |
|---|
| 689 | | } |
|---|
| 690 | | else if (swnsId == wid && canWriteToWord) |
|---|
| 691 | | { |
|---|
| 692 | | glossCell.html = "<form method=\"post\">\n" + |
|---|
| 693 | | "<input type=\"hidden\" name=\"swns\"" + |
|---|
| 694 | | " value=\"" + wid + "\">\n"; |
|---|
| 695 | | |
|---|
| 696 | | for (int i = 0; i < senses.length; i++) |
|---|
| 697 | | { |
|---|
| 698 | | Long key = (Long)(senses[i].getKey()); |
|---|
| 699 | | glossCell.html += |
|---|
| 700 | | "<input type=\"radio\" name=\"wns\"" + |
|---|
| 701 | | " value=\"" + key.longValue() + "\"" + |
|---|
| 702 | | (key.longValue() == |
|---|
| 703 | | wordnetSynset.longValue() ? " checked" : "") + |
|---|
| 704 | | " />" + |
|---|
| 705 | | senses[i].getGloss() |
|---|
| 706 | | .replaceAll("<", "<") |
|---|
| 707 | | .replaceAll(">", ">") + |
|---|
| 708 | | "<br>\n"; |
|---|
| 709 | | } |
|---|
| 710 | | |
|---|
| 711 | | glossCell.html += |
|---|
| 712 | | "<input type=\"submit\" name=\"swnss\""+ |
|---|
| 713 | | " value=\"Save\">\n" + |
|---|
| 714 | | "</form>"; |
|---|
| 715 | | } |
|---|
| 716 | | else if (wordnetSynset == null) |
|---|
| 717 | | { |
|---|
| 718 | | glossCell.html = "(no Wordnet sense selected)"; |
|---|
| 719 | | } |
|---|
| 720 | | else |
|---|
| 721 | | { |
|---|
| 722 | | Synset sense = null; |
|---|
| 723 | | |
|---|
| 724 | | for (int i = 0; i < senses.length; i++) |
|---|
| 725 | | { |
|---|
| 726 | | Long key = (Long)(senses[i].getKey()); |
|---|
| 727 | | if (key.longValue() == |
|---|
| 728 | | wordnetSynset.longValue()) |
|---|
| 729 | | { |
|---|
| 730 | | sense = senses[i]; |
|---|
| 731 | | break; |
|---|
| 732 | | } |
|---|
| 733 | | } |
|---|
| 734 | | |
|---|
| 735 | | if (sense == null) |
|---|
| 736 | | { |
|---|
| 737 | | glossCell.html = |
|---|
| 738 | | "(invalid Wordnet sense selected)"; |
|---|
| 739 | | } |
|---|
| 740 | | else |
|---|
| 741 | | { |
|---|
| 742 | | glossCell.html = sense.getGloss(); |
|---|
| 743 | | } |
|---|
| 744 | | } |
|---|
| 745 | | |
|---|
| 746 | | if (wordnetPos != null && swnsId != wid && |
|---|
| 747 | | canWriteToWord) |
|---|
| 748 | | { |
|---|
| 749 | | glossCell.html += |
|---|
| 750 | | " [<a href=\"clause.jsp?swns=" + wid + |
|---|
| 751 | | "\">change</a>]"; |
|---|
| 752 | | } |
|---|
| 753 | | } |
|---|
| 754 | | |
|---|