Class TrimConstantString

Object
com.owenfeehan.pathpatternfinder.trim.TrimConstantString
All Implemented Interfaces:
TrimOperation<String>

public class TrimConstantString
extends Object
implements TrimOperation<String>
Looks for a constant common substring (from left-size, as maximal as possible).

This is turned into a Constant pattern-element, and otherwise removing

 e.g.
   input:   ["the boy went to school", "the boy went to a party"]
   pattern: ["the boy went to "]
 
Author:
Owen Feehan
  • Constructor Details

    • TrimConstantString

      public TrimConstantString​(UnresolvedPatternElementFactory factory, boolean requiresPeriod)
      Creates given a factory for creating unresolved pattern-elements.
      Parameters:
      factory - the factory
      requiresPeriod - if true, a constant string will only be trimmed from the right if it includes at least one period (useful to prevent file-extensions) from being broken up.
  • Method Details