Class HTMLNamedEntitiesParser.State

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected State()
      Create the empty state
      protected State​(int depth, java.lang.String entityFragment, java.lang.String resolvedValue)
      Create us a new state that describes itself nicely
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void add​(java.lang.String entity, java.lang.String resolvedValue)
      Add a new entity to the pseudo-tree
      protected HTMLNamedEntitiesParser.State lookup​(int character)
      Lookup the state by iterating over the chars at this state, should not be that many and due to the small size of the array, should be cache only
      protected void updateNonSemicolonEntity​(java.lang.String entity, java.lang.String resolvedValue)
      We have a special in between state because some entities exist as correct entity with a semicolon at the end and as legacy version without.
      • Methods inherited from class java.lang.Object

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

      • depth_

        private final int depth_
      • characters_

        int[] characters_
      • entityOrFragment_

        public final java.lang.String entityOrFragment_
      • resolvedValue_

        public java.lang.String resolvedValue_
      • length_

        public final int length_
      • endsWithSemicolon_

        public final boolean endsWithSemicolon_
      • isMatch_

        public boolean isMatch_
      • endNode_

        public boolean endNode_
    • Constructor Detail

      • State

        protected State()
        Create the empty state
      • State

        protected State​(int depth,
                        java.lang.String entityFragment,
                        java.lang.String resolvedValue)
        Create us a new state that describes itself nicely
    • Method Detail

      • updateNonSemicolonEntity

        protected void updateNonSemicolonEntity​(java.lang.String entity,
                                                java.lang.String resolvedValue)
        We have a special in between state because some entities exist as correct entity with a semicolon at the end and as legacy version without. We want to look up both correctly, hence when we build the data set, we have to unmark an existing one as final one and insert one more.
        Parameters:
        entity - the entity to look up
        resolvedValue - the value it will resolve to
      • add

        protected void add​(java.lang.String entity,
                           java.lang.String resolvedValue)
        Add a new entity to the pseudo-tree
        Parameters:
        entity - the entity to look for later
        resolvedValue - the value it resolves to
      • lookup

        protected HTMLNamedEntitiesParser.State lookup​(int character)
        Lookup the state by iterating over the chars at this state, should not be that many and due to the small size of the array, should be cache only
        Parameters:
        character - the char to look up
        Returns:
        the next state or the same in case the character was not found