Class LCSubstringSolver

    • Constructor Detail

      • LCSubstringSolver

        public LCSubstringSolver​(NodeFactory nodeFactory)
        Creates a new LCSubstringSolver which will use the given NodeFactory to create nodes.
        Parameters:
        nodeFactory - An object which creates Node objects on-demand, and which might return node implementations optimized for storing the values supplied to it for the creation of each node
    • Method Detail

      • add

        public boolean add​(java.lang.CharSequence document)
        Adds a CharSequence document to the solver.
        Parameters:
        document - The CharSequence to add to the solver
        Returns:
        True if the document was added, false if it was not because it had been added previously
      • addSuffixesToRadixTree

        void addSuffixesToRadixTree​(java.lang.String keyAsString)
      • getLongestCommonSubstring

        public java.lang.CharSequence getLongestCommonSubstring()
        Finds the longest common substring in the documents added to the solver so far.
        Returns:
        The longest common substring
      • createSetForOriginalKeys

        protected java.util.Set<java.lang.String> createSetForOriginalKeys()