similarity - ANTLR3 implemented Jaccard Similiarity to compare two java's files -
similarity - ANTLR3 implemented Jaccard Similiarity to compare two java's files -
see code, jccd api mashed up. ^_^
bufferedreader in = new bufferedreader(new filereader(f.getfile())); string filepath = f.getnama(); // getname of file final antlr3javalexer lexer = new antlr3javalexer(); lexer.preservewhitespacesandcomments = false; seek { lexer.setcharstream(new antlrreaderstream(in)); } grab (ioexception e) { e.printstacktrace(); homecoming false; } stringbuilder sbu = new stringbuilder(); while (true) { org.antlr.runtime.token token = lexer.nexttoken(); if (token.gettype() == lexer.eof) { break; } sbu.append(token.gettype()); system.out.println(token.gettype()); }
it gives me output testfileone.java
876116423877916429791644323742916418167432388167444266238816449164291643016743444242877916429791641179164432310329164351674323742916420164432316461643016444426623164616430164444242881644442879010116429164164224143234242[]
and testfiletwo.java
876116423877916429791644323742916418167432388167444266238816449164291643016743444242877916429791641179164432310329164351674323742916420164432316461643016444426623164616430164444242881644442879010116429164164224143234242[]
now qusetion is, can give me clue or suggestion implemented jaccard similiarity expected result output percentage of similiarity both ? give thanks much ...
java similarity
Comments
Post a Comment