Class BookUtils


  • public class BookUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      BookUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int calcDiff​(java.lang.String word1, java.lang.String word2)
      Very simple algorithm to calc the diff betwenn 2 words.
      (package private) static int findTemplate​(java.lang.String wikiText, java.lang.String tempalateName, int fromIndex)
      Find a template name in the wiki text.
      (package private) static java.util.Properties parseRule​(java.lang.String wikiText, int idxStart, int idxEnd)
      Read the information of the template placeholder
      (package private) static java.util.Properties parseRule​(java.lang.String wikiText, java.lang.String tempalateName, int fromIndex)
      Read the information of the template placeholder
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BookUtils

        public BookUtils()
    • Method Detail

      • parseRule

        static java.util.Properties parseRule​(java.lang.String wikiText,
                                              java.lang.String tempalateName,
                                              int fromIndex)
        Read the information of the template placeholder
        Returns:
        null if nothing find
      • parseRule

        static java.util.Properties parseRule​(java.lang.String wikiText,
                                              int idxStart,
                                              int idxEnd)
        Read the information of the template placeholder
      • findTemplate

        static int findTemplate​(java.lang.String wikiText,
                                java.lang.String tempalateName,
                                int fromIndex)
        Find a template name in the wiki text. the problem are possible whitespaces.
        Parameters:
        wikiText -
        tempalateName -
        Returns:
        the index after the first | or -1.
      • calcDiff

        public static int calcDiff​(java.lang.String word1,
                                   java.lang.String word2)
        Very simple algorithm to calc the diff betwenn 2 words.