de.unihalle.informatik.MiToBo.tools.strings
Class StringAnalysis

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.tools.strings.StringAnalysis

public class StringAnalysis
extends Object

Class providing helpers to analyze (sets of) strings.

Author:
moeller

Constructor Summary
StringAnalysis()
           
 
Method Summary
protected static Vector<String> findPrefixes(Vector<String> vec)
          Helper to recursively extract common prefixes.
static Vector<String> getLongestCommonPrefixes(Vector<String> vec)
          Extracts the set of all prefixes shared by at least two strings in the given set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringAnalysis

public StringAnalysis()
Method Detail

getLongestCommonPrefixes

public static Vector<String> getLongestCommonPrefixes(Vector<String> vec)
Extracts the set of all prefixes shared by at least two strings in the given set.

Parameters:
vec - Set of strings to be analyzed.
Returns:
Set of common prefixes.

findPrefixes

protected static Vector<String> findPrefixes(Vector<String> vec)
Helper to recursively extract common prefixes.

Parameters:
vec - Set of strings to analyze.
Returns:
Set of common prefixes.


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.