18 March 2019

This project provides a common set of interfaces for all CS350
CodeComp project variants.

It also provides a SharedPhrases class used to store token lists
obtained via lexical analysis of the source code.

Information

Current version: 1.3

  • Import into Gradle as

    repositories {
        ...
        ivy { 
            url 'https://secweb.cs.odu.edu/~zeil/ivyrepo'
        }
     }
    
    dependencies {
        compile 'edu.odo.cs.cs350:codeCompCommon: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.