18 March 2019

Sourced Suffix Trees

This project provides a suffix tree of strings that allows a
string identifier to designate the source of each incoming
string.

The source may indicate a person, a file path, or whatever
the user deems useful.

Limitations

Each unique source is assigned a distinct single-character identifier
which must not occur in the input strings. These identifiers are drawn
from the Unicode Private Use
Area

to minimize potential conflicts with string content.

Information

Current version: 1.3

  • Import into Gradle as

    repositories {
        ...
        ivy { 
            url 'https://www.cs.odu.edu/~zeil/ivyrepo'
        }
     }
    
    dependencies {
        implementation 'edu.odu.cs.cs350:sourcedSuffixTrees:1.3'
        ...
    }
    
  • Project reports,
    including Javadocs

Usage

SharedPhrases phrases = new SharedPhrases(); 
phrases.addSentence ("abc", "jones"); // Jones has written abc
phrases.addSentence ("ab", "smith"); // Smith has written ab
phrases.addSentence ("ac", "doe"); // Doe has written ac
for (String p: phrases.allPhrases()) {
   System.out.print (p + ":");
   for (String source: phrases.sourcesOf(p)) {
       System.out.print (" " + source);
   } 
   System.out.println();
}

The output would be something like:

 a: jones smith doe
 ab: jones smith
 ac: jones doe
 abc: jones
 b: jones smith
 bc: jones
 c: jones doe

though the order of the lines and the order of source names within each line
may vary.