Skip to content

Commit

Permalink
re-factor.
Browse files Browse the repository at this point in the history
  • Loading branch information
parrt committed Jun 27, 2016
1 parent 739715f commit 5e82023
Show file tree
Hide file tree
Showing 33 changed files with 553 additions and 559 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Either techniques are painful and finicky.

This repository is a step towards what we hope will be a universal code formatter that uses machine learning to look for patterns in a corpus and to format code using those patterns.

*Holy shit!* It appears to work. Working on a paper to be submitted June 2016. Details therein.
*Whoa!* It appears to work. Working on a paper to be submitted June 2016. Details therein.

## Build complete jar

Expand Down
11 changes: 5 additions & 6 deletions src/org/antlr/codebuff/Corpus.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@
import java.util.Map;
import java.util.Random;

import static org.antlr.codebuff.Dbg.getFilenames;
import static org.antlr.codebuff.Dbg.getLexer;
import static org.antlr.codebuff.Dbg.getParser;
import static org.antlr.codebuff.Dbg.load;
import static org.antlr.codebuff.Dbg.showFileNames;
import static org.antlr.codebuff.Tool.getFilenames;
import static org.antlr.codebuff.Tool.getLexer;
import static org.antlr.codebuff.Tool.getParser;
import static org.antlr.codebuff.Tool.showFileNames;

public class Corpus {
public static final int FEATURE_VECTOR_RANDOM_SEED = 314159; // need randomness but use same seed to get reproducibility
Expand Down Expand Up @@ -67,7 +66,7 @@ public Corpus(String rootDir, LangDescriptor language) throws Exception {
this.language = language;
if ( documents==null ) {
List<String> allFiles = getFilenames(new File(rootDir), language.fileRegex);
documents = load(allFiles, language);
documents = Tool.load(allFiles, language);
}
}

Expand Down
Loading

0 comments on commit 5e82023

Please sign in to comment.