Package com.hp.hpl.sparta

Examples of com.hp.hpl.sparta.Element


      String xpathQuery1 =
          "//" + sourcePinyinSystem.getTagName() + "[text()='" + pinyinString + "']";

      Document pinyinMappingDoc = PinyinRomanizationResource.getInstance().getPinyinMappingDoc();

      Element hanyuNode = pinyinMappingDoc.xpathSelectElement(xpathQuery1);

      if (null != hanyuNode) {
        // find the node of target Pinyin system
        String xpathQuery2 = "../" + targetPinyinSystem.getTagName() + "/text()";
        String targetPinyinStrWithoutToneNumber = hanyuNode.xpathSelectString(xpathQuery2);

        targetPinyinStr = targetPinyinStrWithoutToneNumber + toneNumberStr;
      }
    } catch (ParseException e) {
      e.printStackTrace();
View Full Code Here


              + "']";

      Document pinyinToGwoyeuMappingDoc =
          GwoyeuRomatzyhResource.getInstance().getPinyinToGwoyeuMappingDoc();

      Element hanyuNode = pinyinToGwoyeuMappingDoc.xpathSelectElement(xpathQuery1);

      if (null != hanyuNode) {
        // find the node of target Pinyin system
        String xpathQuery2 =
            "../" + PinyinRomanizationType.GWOYEU_ROMATZYH.getTagName()
                + tones[Integer.parseInt(toneNumberStr) - 1] + "/text()";
        String targetPinyinStrWithoutToneNumber = hanyuNode.xpathSelectString(xpathQuery2);

        gwoyeuStr = targetPinyinStrWithoutToneNumber;
      }
    } catch (ParseException e) {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of com.hp.hpl.sparta.Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.