Skip to content

Commit

Permalink
支持纯速度测试
Browse files Browse the repository at this point in the history
  • Loading branch information
ysc committed May 15, 2015
1 parent 944a26c commit 9be64b0
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/org/apdplat/evaluation/Evaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,24 @@
public class Evaluator {
public static void main(String[] args) throws Exception{
long start = System.currentTimeMillis();
String testText = null;
String standardText = null;
//可通过命令行参数指定不评估的分词器
Set<String> excludes = new HashSet<>();
for(String exclude : args){
excludes.add(exclude);
System.out.println("不评估:" + exclude);
for(String arg : args){
if(arg.endsWith(".jar")){
continue;
}
if(arg.startsWith("-testText=")){
testText=arg.replace("-testText=", "").trim();
continue;
}
if(arg.startsWith("-standardText=")){
testText=arg.replace("-standardText=", "").trim();
continue;
}
excludes.add(arg);
System.out.println("不评估:" + arg);
}
List<Class> classes = new ArrayList<>();
if(args.length>0 && new File(args[0]).exists()){
Expand All @@ -55,6 +68,10 @@ public static void main(String[] args) throws Exception{
List<EvaluationResult> list = new ArrayList<>();
for(Class clazz : classes){
Evaluation eval = (Evaluation)clazz.newInstance();
if(testText!=null) {
eval.setTestText(testText);
eval.setStandardText(standardText);
}
list.addAll(eval.run());
}
Evaluation.generateReport(list);
Expand Down

0 comments on commit 9be64b0

Please sign in to comment.