repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.tutorial/src/main/java/de/tudarmstadt/ukp/wikipedia/tutorial/parser/T6_NestedLists.java
T6_NestedLists.outputNestedList
public static String outputNestedList(NestedList nl, int depth){ String result = ""; if(nl == null) { return result; // If null return empty string } for(int i = 0; i<depth; i++) { result += " "; // insert indentation according to depth } if(nl.getClass() == NestedListElement.class){ // If it...
java
public static String outputNestedList(NestedList nl, int depth){ String result = ""; if(nl == null) { return result; // If null return empty string } for(int i = 0; i<depth; i++) { result += " "; // insert indentation according to depth } if(nl.getClass() == NestedListElement.class){ // If it...
[ "public", "static", "String", "outputNestedList", "(", "NestedList", "nl", ",", "int", "depth", ")", "{", "String", "result", "=", "\"\"", ";", "if", "(", "nl", "==", "null", ")", "{", "return", "result", ";", "// If null return empty string", "}", "for", ...
Returns String with all elements of a NestedList @param nl NestedList @param depth Current depth of the Nestedlist @return
[ "Returns", "String", "with", "all", "elements", "of", "a", "NestedList" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.tutorial/src/main/java/de/tudarmstadt/ukp/wikipedia/tutorial/parser/T6_NestedLists.java#L71-L95
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/dump/writer/SQLDatabaseWriter.java
SQLDatabaseWriter.writeHeader
private void writeHeader() throws SQLException { Statement query; String[] revTableHeaderQueries; revTableHeaderQueries = sqlEncoder.getTable(); //commit revision table header for (String revTableHeaderQuery : revTableHeaderQueries) { query = connection.createStatement(); query.executeUpdate(revT...
java
private void writeHeader() throws SQLException { Statement query; String[] revTableHeaderQueries; revTableHeaderQueries = sqlEncoder.getTable(); //commit revision table header for (String revTableHeaderQuery : revTableHeaderQueries) { query = connection.createStatement(); query.executeUpdate(revT...
[ "private", "void", "writeHeader", "(", ")", "throws", "SQLException", "{", "Statement", "query", ";", "String", "[", "]", "revTableHeaderQueries", ";", "revTableHeaderQueries", "=", "sqlEncoder", ".", "getTable", "(", ")", ";", "//commit revision table header", "for...
Retrieves the encoded sql orders and executes them. @throws SQLException if an error occurred while accessing the database
[ "Retrieves", "the", "encoded", "sql", "orders", "and", "executes", "them", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/dump/writer/SQLDatabaseWriter.java#L213-L230
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/archivers/Bzip2Archiver.java
Bzip2Archiver.compress
public void compress(String path) { try { File fileToArchive = new File(path); BufferedInputStream input = new BufferedInputStream(new FileInputStream(fileToArchive)); File archivedFile = new File(fileToArchive.getName() + ".bz2"); archivedFile.createNewFile(); FileOutputStream fos = new FileOutpu...
java
public void compress(String path) { try { File fileToArchive = new File(path); BufferedInputStream input = new BufferedInputStream(new FileInputStream(fileToArchive)); File archivedFile = new File(fileToArchive.getName() + ".bz2"); archivedFile.createNewFile(); FileOutputStream fos = new FileOutpu...
[ "public", "void", "compress", "(", "String", "path", ")", "{", "try", "{", "File", "fileToArchive", "=", "new", "File", "(", "path", ")", ";", "BufferedInputStream", "input", "=", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "fileToArchive...
Creates bz2 archive file from file in path @param path to file to compress
[ "Creates", "bz2", "archive", "file", "from", "file", "in", "path" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/archivers/Bzip2Archiver.java#L52-L91
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/archivers/Bzip2Archiver.java
Bzip2Archiver.getCompressionStream
public OutputStream getCompressionStream(String path) throws IOException { File archivedFile = new File(path); archivedFile.createNewFile(); FileOutputStream fos = new FileOutputStream(archivedFile); BufferedOutputStream bufStr = new BufferedOutputStream(fos); // added bzip2 prefix fos.write("BZ".getB...
java
public OutputStream getCompressionStream(String path) throws IOException { File archivedFile = new File(path); archivedFile.createNewFile(); FileOutputStream fos = new FileOutputStream(archivedFile); BufferedOutputStream bufStr = new BufferedOutputStream(fos); // added bzip2 prefix fos.write("BZ".getB...
[ "public", "OutputStream", "getCompressionStream", "(", "String", "path", ")", "throws", "IOException", "{", "File", "archivedFile", "=", "new", "File", "(", "path", ")", ";", "archivedFile", ".", "createNewFile", "(", ")", ";", "FileOutputStream", "fos", "=", ...
Creates stream for compression @param path path to file to compress @return compression stream @throws IOException
[ "Creates", "stream", "for", "compression" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/archivers/Bzip2Archiver.java#L101-L116
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/archivers/Bzip2Archiver.java
Bzip2Archiver.getDecompressionStream
public InputStreamReader getDecompressionStream(String path, String encoding) throws IOException { File fileToUncompress = new File(path); BufferedInputStream fileStream = new BufferedInputStream(new FileInputStream(fileToUncompress)); // read bzip2 prefix: BZ fileStream.read(); fileStream.read(); Buf...
java
public InputStreamReader getDecompressionStream(String path, String encoding) throws IOException { File fileToUncompress = new File(path); BufferedInputStream fileStream = new BufferedInputStream(new FileInputStream(fileToUncompress)); // read bzip2 prefix: BZ fileStream.read(); fileStream.read(); Buf...
[ "public", "InputStreamReader", "getDecompressionStream", "(", "String", "path", ",", "String", "encoding", ")", "throws", "IOException", "{", "File", "fileToUncompress", "=", "new", "File", "(", "path", ")", ";", "BufferedInputStream", "fileStream", "=", "new", "B...
Creates Stream for decompression @param path path to file to uncompress @param encoding ecoding to use @return decompression stream @throws IOException
[ "Creates", "Stream", "for", "decompression" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/archivers/Bzip2Archiver.java#L128-L145
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/archivers/Bzip2Archiver.java
Bzip2Archiver.decompress
public void decompress(String path) throws IOException { File bzip2 = new File(path); // File unarchived = new File(bzip2.getName().replace(".bz2", "")); unarchived.createNewFile(); BufferedInputStream inputStr = new BufferedInputStream(new FileInputStream(bzip2)); // read bzip2 prefix inputStr.rea...
java
public void decompress(String path) throws IOException { File bzip2 = new File(path); // File unarchived = new File(bzip2.getName().replace(".bz2", "")); unarchived.createNewFile(); BufferedInputStream inputStr = new BufferedInputStream(new FileInputStream(bzip2)); // read bzip2 prefix inputStr.rea...
[ "public", "void", "decompress", "(", "String", "path", ")", "throws", "IOException", "{", "File", "bzip2", "=", "new", "File", "(", "path", ")", ";", "//", "File", "unarchived", "=", "new", "File", "(", "bzip2", ".", "getName", "(", ")", ".", "replace"...
Uncompress bz2 file @param path path to file to uncompress @throws IOException
[ "Uncompress", "bz2", "file" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/archivers/Bzip2Archiver.java#L154-L191
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/ArticleIndex.java
ArticleIndex.add
public void add(final int currentArticleID, final long startTime, final long endTime, final List<ArticleIndexData> infoList) { // index_articleID_rc_ts if (!infoList.isEmpty()) { StringBuilder fullRevBuffer = new StringBuilder(); StringBuilder revCountBuffer = new StringBuilder(); boolean first = tr...
java
public void add(final int currentArticleID, final long startTime, final long endTime, final List<ArticleIndexData> infoList) { // index_articleID_rc_ts if (!infoList.isEmpty()) { StringBuilder fullRevBuffer = new StringBuilder(); StringBuilder revCountBuffer = new StringBuilder(); boolean first = tr...
[ "public", "void", "add", "(", "final", "int", "currentArticleID", ",", "final", "long", "startTime", ",", "final", "long", "endTime", ",", "final", "List", "<", "ArticleIndexData", ">", "infoList", ")", "{", "// index_articleID_rc_ts", "if", "(", "!", "infoLis...
Adds the information for an new entry in the article index. @param currentArticleID ID of the currently used article @param startTime First date of appearance @param endTime Last date of appearance @param infoList List of revision blocks
[ "Adds", "the", "information", "for", "an", "new", "entry", "in", "the", "article", "index", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/ArticleIndex.java#L64-L126
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java
EmptyStructureRemover.eliminateEmptyStructures
public static SectionContainer eliminateEmptyStructures( SectionContainer sc ){ for( int i=sc.nrOfSubSections()-1; i>=0; i-- ){ Section ss = sc.getSubSection( i ); if( ss.getClass() == SectionContainer.class ){ SectionContainer sci = (SectionContainer)ss; eliminateEmptyStructures( sci ); } ...
java
public static SectionContainer eliminateEmptyStructures( SectionContainer sc ){ for( int i=sc.nrOfSubSections()-1; i>=0; i-- ){ Section ss = sc.getSubSection( i ); if( ss.getClass() == SectionContainer.class ){ SectionContainer sci = (SectionContainer)ss; eliminateEmptyStructures( sci ); } ...
[ "public", "static", "SectionContainer", "eliminateEmptyStructures", "(", "SectionContainer", "sc", ")", "{", "for", "(", "int", "i", "=", "sc", ".", "nrOfSubSections", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "Section", "ss", ...
Removes all empty Structures from a SectionContainer and all substructures.
[ "Removes", "all", "empty", "Structures", "from", "a", "SectionContainer", "and", "all", "substructures", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java#L43-L69
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java
EmptyStructureRemover.eliminateEmptyStructures
public static SectionContent eliminateEmptyStructures( SectionContent sc ){ for( int i=sc.nrOfParagraphs()-1; i>=0; i-- ){ Paragraph p = sc.getParagraph(i); if( p.empty() ) sc.removeParagraph( p ); } for( int i=sc.nrOfDefinitionLists()-1; i>=0; i--){ DefinitionList dl = sc.getDefinitionList(i); el...
java
public static SectionContent eliminateEmptyStructures( SectionContent sc ){ for( int i=sc.nrOfParagraphs()-1; i>=0; i-- ){ Paragraph p = sc.getParagraph(i); if( p.empty() ) sc.removeParagraph( p ); } for( int i=sc.nrOfDefinitionLists()-1; i>=0; i--){ DefinitionList dl = sc.getDefinitionList(i); el...
[ "public", "static", "SectionContent", "eliminateEmptyStructures", "(", "SectionContent", "sc", ")", "{", "for", "(", "int", "i", "=", "sc", ".", "nrOfParagraphs", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "Paragraph", "p", "=",...
Removes all empty Structures from a SectionContent and all substructures.
[ "Removes", "all", "empty", "Structures", "from", "a", "SectionContent", "and", "all", "substructures", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java#L74-L100
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java
EmptyStructureRemover.eliminateEmptyStructures
public static NestedListContainer eliminateEmptyStructures( NestedListContainer nlc ){ for(int i=nlc.size()-1; i>=0; i--){ NestedList nl = nlc.getNestedList(i); if( nl.getClass()==NestedListContainer.class ) eliminateEmptyStructures( (NestedListContainer)nl ); if( nl.empty() )nlc.remove( nl ); }...
java
public static NestedListContainer eliminateEmptyStructures( NestedListContainer nlc ){ for(int i=nlc.size()-1; i>=0; i--){ NestedList nl = nlc.getNestedList(i); if( nl.getClass()==NestedListContainer.class ) eliminateEmptyStructures( (NestedListContainer)nl ); if( nl.empty() )nlc.remove( nl ); }...
[ "public", "static", "NestedListContainer", "eliminateEmptyStructures", "(", "NestedListContainer", "nlc", ")", "{", "for", "(", "int", "i", "=", "nlc", ".", "size", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "NestedList", "nl", ...
Removes all empty Structures from a NestedListContainer and all substructures.
[ "Removes", "all", "empty", "Structures", "from", "a", "NestedListContainer", "and", "all", "substructures", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java#L105-L114
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java
EmptyStructureRemover.eliminateEmptyStructures
public static Table eliminateEmptyStructures( Table t ){ for( int i=t.nrOfTableElements()-1; i>=0; i-- ){ TableElement te = t.getTableElement(i); eliminateEmptyStructures( te ); if( te.empty() ) t.removeTableElement( te ); } return t; }
java
public static Table eliminateEmptyStructures( Table t ){ for( int i=t.nrOfTableElements()-1; i>=0; i-- ){ TableElement te = t.getTableElement(i); eliminateEmptyStructures( te ); if( te.empty() ) t.removeTableElement( te ); } return t; }
[ "public", "static", "Table", "eliminateEmptyStructures", "(", "Table", "t", ")", "{", "for", "(", "int", "i", "=", "t", ".", "nrOfTableElements", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "TableElement", "te", "=", "t", "."...
Removes all empty Structures from a Table and all substructures.
[ "Removes", "all", "empty", "Structures", "from", "a", "Table", "and", "all", "substructures", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java#L119-L126
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java
EmptyStructureRemover.eliminateEmptyStructures
public static TableElement eliminateEmptyStructures( TableElement te ){ for( int i=te.nrOfSections()-1; i>=0; i--){ Section s = te.getSection(i); if( s.getClass() == SectionContainer.class ) eliminateEmptyStructures( (SectionContainer)s ); else if( s.getClass() == SectionContent.class ) eliminate...
java
public static TableElement eliminateEmptyStructures( TableElement te ){ for( int i=te.nrOfSections()-1; i>=0; i--){ Section s = te.getSection(i); if( s.getClass() == SectionContainer.class ) eliminateEmptyStructures( (SectionContainer)s ); else if( s.getClass() == SectionContent.class ) eliminate...
[ "public", "static", "TableElement", "eliminateEmptyStructures", "(", "TableElement", "te", ")", "{", "for", "(", "int", "i", "=", "te", ".", "nrOfSections", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "Section", "s", "=", "te",...
Removes all empty Structures from a TableElement and all substructures.
[ "Removes", "all", "empty", "Structures", "from", "a", "TableElement", "and", "all", "substructures", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java#L131-L143
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java
EmptyStructureRemover.eliminateEmptyStructures
public static DefinitionList eliminateEmptyStructures( DefinitionList dl ){ ContentElement dt = dl.getDefinedTerm(); if( dt!=null && dt.empty() ) dl.setDefinedTerm( null ); for(int i=dl.nrOfDefinitions()-1; i>=0; i-- ){ ContentElement ce = dl.getDefinition(i); if( ce.empty() )dl.removeDefinition( ce )...
java
public static DefinitionList eliminateEmptyStructures( DefinitionList dl ){ ContentElement dt = dl.getDefinedTerm(); if( dt!=null && dt.empty() ) dl.setDefinedTerm( null ); for(int i=dl.nrOfDefinitions()-1; i>=0; i-- ){ ContentElement ce = dl.getDefinition(i); if( ce.empty() )dl.removeDefinition( ce )...
[ "public", "static", "DefinitionList", "eliminateEmptyStructures", "(", "DefinitionList", "dl", ")", "{", "ContentElement", "dt", "=", "dl", ".", "getDefinedTerm", "(", ")", ";", "if", "(", "dt", "!=", "null", "&&", "dt", ".", "empty", "(", ")", ")", "dl", ...
Removes all empty Structures from a DefinitionList and all substructures.
[ "Removes", "all", "empty", "Structures", "from", "a", "DefinitionList", "and", "all", "substructures", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/EmptyStructureRemover.java#L148-L158
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/WikipediaXMLReader.java
WikipediaXMLReader.initXMLKeys
private void initXMLKeys() { this.keywords = new SingleKeywordTree<WikipediaXMLKeys>(); keywords.addKeyword(WikipediaXMLKeys.KEY_START_PAGE.getKeyword(), WikipediaXMLKeys.KEY_START_PAGE); keywords.addKeyword(WikipediaXMLKeys.KEY_END_PAGE.getKeyword(), WikipediaXMLKeys.KEY_END_PAGE); keywords.addKeywor...
java
private void initXMLKeys() { this.keywords = new SingleKeywordTree<WikipediaXMLKeys>(); keywords.addKeyword(WikipediaXMLKeys.KEY_START_PAGE.getKeyword(), WikipediaXMLKeys.KEY_START_PAGE); keywords.addKeyword(WikipediaXMLKeys.KEY_END_PAGE.getKeyword(), WikipediaXMLKeys.KEY_END_PAGE); keywords.addKeywor...
[ "private", "void", "initXMLKeys", "(", ")", "{", "this", ".", "keywords", "=", "new", "SingleKeywordTree", "<", "WikipediaXMLKeys", ">", "(", ")", ";", "keywords", ".", "addKeyword", "(", "WikipediaXMLKeys", ".", "KEY_START_PAGE", ".", "getKeyword", "(", ")", ...
Creates and initializes the xml keyword tree.
[ "Creates", "and", "initializes", "the", "xml", "keyword", "tree", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/WikipediaXMLReader.java#L145-L195
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/WikipediaXMLReader.java
WikipediaXMLReader.initNamespaces
private void initNamespaces(){ Map<Integer, String> namespaceMap = new HashMap<Integer,String>(); try{ int b = read(); this.keywords.reset(); StringBuilder buffer = null; while (b != -1) { // System.out.print((char)b); if (buffer != null) { buffer.append((char) b); } if (this.key...
java
private void initNamespaces(){ Map<Integer, String> namespaceMap = new HashMap<Integer,String>(); try{ int b = read(); this.keywords.reset(); StringBuilder buffer = null; while (b != -1) { // System.out.print((char)b); if (buffer != null) { buffer.append((char) b); } if (this.key...
[ "private", "void", "initNamespaces", "(", ")", "{", "Map", "<", "Integer", ",", "String", ">", "namespaceMap", "=", "new", "HashMap", "<", "Integer", ",", "String", ">", "(", ")", ";", "try", "{", "int", "b", "=", "read", "(", ")", ";", "this", "."...
Reads the namespaces from the siteinfo section and processes them in order to initialize the ArticleFilter
[ "Reads", "the", "namespaces", "from", "the", "siteinfo", "section", "and", "processes", "them", "in", "order", "to", "initialize", "the", "ArticleFilter" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/WikipediaXMLReader.java#L201-L261
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/WikipediaXMLReader.java
WikipediaXMLReader.readHeader
protected boolean readHeader() throws IOException, ArticleReaderException { this.taskHeader = new ArticleInformation(); int size, r = read(); StringBuilder buffer = null; while (r != -1) { if (buffer != null) { buffer.append((char) r); } if (this.keywords.check((char) r)) { switch (this...
java
protected boolean readHeader() throws IOException, ArticleReaderException { this.taskHeader = new ArticleInformation(); int size, r = read(); StringBuilder buffer = null; while (r != -1) { if (buffer != null) { buffer.append((char) r); } if (this.keywords.check((char) r)) { switch (this...
[ "protected", "boolean", "readHeader", "(", ")", "throws", "IOException", ",", "ArticleReaderException", "{", "this", ".", "taskHeader", "=", "new", "ArticleInformation", "(", ")", ";", "int", "size", ",", "r", "=", "read", "(", ")", ";", "StringBuilder", "bu...
Reads the header of an article. @return FALSE if the article was not accepted by the articleFilter TRUE if no name checker was used, or if the articleFilter accepted the ArticleName @throws IOException if an error occurs while reading from the input @throws ArticleReaderException if an error occurs while parsing the ...
[ "Reads", "the", "header", "of", "an", "article", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/WikipediaXMLReader.java#L354-L423
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/WikipediaXMLReader.java
WikipediaXMLReader.readContributor
protected void readContributor(Revision rev, String str) throws IOException, ArticleReaderException { char[] contrChars = str.toCharArray(); int size; StringBuilder buffer = null; this.keywords.reset(); for(char curChar:contrChars){ if (buffer != null) { buffer.append(curChar); } if (this.ke...
java
protected void readContributor(Revision rev, String str) throws IOException, ArticleReaderException { char[] contrChars = str.toCharArray(); int size; StringBuilder buffer = null; this.keywords.reset(); for(char curChar:contrChars){ if (buffer != null) { buffer.append(curChar); } if (this.ke...
[ "protected", "void", "readContributor", "(", "Revision", "rev", ",", "String", "str", ")", "throws", "IOException", ",", "ArticleReaderException", "{", "char", "[", "]", "contrChars", "=", "str", ".", "toCharArray", "(", ")", ";", "int", "size", ";", "String...
Parses the content within the contributor tags and adds the parsed info to the provided revision object. @param rev the revision object to store the parsed info in @param str the contributor data to be parsed @throws IOException @throws ArticleReaderException
[ "Parses", "the", "content", "within", "the", "contributor", "tags", "and", "adds", "the", "parsed", "info", "to", "the", "provided", "revision", "object", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/article/reader/WikipediaXMLReader.java#L571-L631
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoGenerator.java
WikipediaTemplateInfoGenerator.extractTemplates
private void extractTemplates() throws WikiApiException { PageIterator pageIter = new PageIterator(getWiki(), true, pageBuffer); RevisionApi revApi = new RevisionApi(dbConf); int pageCounter = 0; long revisionCounter =0L; while (pageIter.hasNext()) { pageCounter++; if (pageCounter % VERBOSITY == 0) ...
java
private void extractTemplates() throws WikiApiException { PageIterator pageIter = new PageIterator(getWiki(), true, pageBuffer); RevisionApi revApi = new RevisionApi(dbConf); int pageCounter = 0; long revisionCounter =0L; while (pageIter.hasNext()) { pageCounter++; if (pageCounter % VERBOSITY == 0) ...
[ "private", "void", "extractTemplates", "(", ")", "throws", "WikiApiException", "{", "PageIterator", "pageIter", "=", "new", "PageIterator", "(", "getWiki", "(", ")", ",", "true", ",", "pageBuffer", ")", ";", "RevisionApi", "revApi", "=", "new", "RevisionApi", ...
Extracts templates from pages and revisions
[ "Extracts", "templates", "from", "pages", "and", "revisions" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoGenerator.java#L156-L199
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoGenerator.java
WikipediaTemplateInfoGenerator.processPages
private void processPages() { PageIterator pageIter = new PageIterator(getWiki(), true, pageBuffer); int pageCounter = 0; while (pageIter.hasNext()) { pageCounter++; if (pageCounter % VERBOSITY == 0) { logger.info("{} pages processed ...", pageCounter); } Page curPage = pageIter.next(); in...
java
private void processPages() { PageIterator pageIter = new PageIterator(getWiki(), true, pageBuffer); int pageCounter = 0; while (pageIter.hasNext()) { pageCounter++; if (pageCounter % VERBOSITY == 0) { logger.info("{} pages processed ...", pageCounter); } Page curPage = pageIter.next(); in...
[ "private", "void", "processPages", "(", ")", "{", "PageIterator", "pageIter", "=", "new", "PageIterator", "(", "getWiki", "(", ")", ",", "true", ",", "pageBuffer", ")", ";", "int", "pageCounter", "=", "0", ";", "while", "(", "pageIter", ".", "hasNext", "...
Extracts templates from pages only
[ "Extracts", "templates", "from", "pages", "only" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoGenerator.java#L205-L224
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoGenerator.java
WikipediaTemplateInfoGenerator.processRevisions
private void processRevisions() { logger.info("Processing revisions, extracting template information ..."); RevisionIterator revisionIter=null; try{ revisionIter = new RevisionIterator(dbConf); int revCounter = 0; while (revisionIter.hasNext()) { revCounter++; if (revCounter % VERBOSITY == 0) ...
java
private void processRevisions() { logger.info("Processing revisions, extracting template information ..."); RevisionIterator revisionIter=null; try{ revisionIter = new RevisionIterator(dbConf); int revCounter = 0; while (revisionIter.hasNext()) { revCounter++; if (revCounter % VERBOSITY == 0) ...
[ "private", "void", "processRevisions", "(", ")", "{", "logger", ".", "info", "(", "\"Processing revisions, extracting template information ...\"", ")", ";", "RevisionIterator", "revisionIter", "=", "null", ";", "try", "{", "revisionIter", "=", "new", "RevisionIterator",...
Processes only revision templates using the Revision Iterator
[ "Processes", "only", "revision", "templates", "using", "the", "Revision", "Iterator" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoGenerator.java#L230-L262
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoGenerator.java
WikipediaTemplateInfoGenerator.generateTemplateIndices
private void generateTemplateIndices(WikipediaTemplateInfo info, Set<String> templateNames) { try { for (String name : templateNames) { int id = info.checkTemplateId(name); if (id != -1) { tplNameToTplId.put(name, id); } } } catch (WikiApiException e) { } }
java
private void generateTemplateIndices(WikipediaTemplateInfo info, Set<String> templateNames) { try { for (String name : templateNames) { int id = info.checkTemplateId(name); if (id != -1) { tplNameToTplId.put(name, id); } } } catch (WikiApiException e) { } }
[ "private", "void", "generateTemplateIndices", "(", "WikipediaTemplateInfo", "info", ",", "Set", "<", "String", ">", "templateNames", ")", "{", "try", "{", "for", "(", "String", "name", ":", "templateNames", ")", "{", "int", "id", "=", "info", ".", "checkTemp...
Loads existing ids into the map. If no id exists, a template will get a new one in the dump writer @param info Must not be {@code null}. @param templateNames template names to use
[ "Loads", "existing", "ids", "into", "the", "map", ".", "If", "no", "id", "exists", "a", "template", "will", "get", "a", "new", "one", "in", "the", "dump", "writer" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoGenerator.java#L331-L345
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.timemachine/src/main/java/de/tudarmstadt/ukp/wikipedia/timemachine/dump/xml/XMLDumpTableInputStream.java
XMLDumpTableInputStream.initialize
@Override public void initialize(InputStream inputStream, DumpTableEnum table) throws IOException { unbufferedResult = new PipedInputStream(); decodedStream = new PipedOutputStream(unbufferedResult); result = new BufferedInputStream(unbufferedResult, BUFFERSIZE); xmlInputThread = new XMLDumpTableInputS...
java
@Override public void initialize(InputStream inputStream, DumpTableEnum table) throws IOException { unbufferedResult = new PipedInputStream(); decodedStream = new PipedOutputStream(unbufferedResult); result = new BufferedInputStream(unbufferedResult, BUFFERSIZE); xmlInputThread = new XMLDumpTableInputS...
[ "@", "Override", "public", "void", "initialize", "(", "InputStream", "inputStream", ",", "DumpTableEnum", "table", ")", "throws", "IOException", "{", "unbufferedResult", "=", "new", "PipedInputStream", "(", ")", ";", "decodedStream", "=", "new", "PipedOutputStream",...
Decorator for InputStream, which allows to convert an XML input stream to SQL @param inputStream XML input stream @throws IOException
[ "Decorator", "for", "InputStream", "which", "allows", "to", "convert", "an", "XML", "input", "stream", "to", "SQL" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.timemachine/src/main/java/de/tudarmstadt/ukp/wikipedia/timemachine/dump/xml/XMLDumpTableInputStream.java#L67-L79
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/dump/sql/SQLFileParser.java
SQLFileParser.init
protected void init(InputStream inputStream) throws IOException { stream = inputStream; st = new StreamTokenizer(new BufferedReader(new InputStreamReader( stream, ENCODING))); EOF_reached = false; skipStatements(); }
java
protected void init(InputStream inputStream) throws IOException { stream = inputStream; st = new StreamTokenizer(new BufferedReader(new InputStreamReader( stream, ENCODING))); EOF_reached = false; skipStatements(); }
[ "protected", "void", "init", "(", "InputStream", "inputStream", ")", "throws", "IOException", "{", "stream", "=", "inputStream", ";", "st", "=", "new", "StreamTokenizer", "(", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "stream", ",", "ENCODIN...
Init the SQLFileParser with the input stream @param inputStream @throws IOException
[ "Init", "the", "SQLFileParser", "with", "the", "input", "stream" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/dump/sql/SQLFileParser.java#L51-L59
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/panels/SQLPanel.java
SQLPanel.validateSQLFields
private void validateSQLFields() { boolean flag = controller.isEnableSQLDatabaseOutput(); enableSQLDatabaseConnection.setSelected(flag); sqlHostLabel.setEnabled(flag); sqlHostField.setEnabled(flag); sqlDatabaseLabel.setEnabled(flag); sqlDatabaseField.setEnabled(flag); sqlUserLabel.setEnabled(flag); ...
java
private void validateSQLFields() { boolean flag = controller.isEnableSQLDatabaseOutput(); enableSQLDatabaseConnection.setSelected(flag); sqlHostLabel.setEnabled(flag); sqlHostField.setEnabled(flag); sqlDatabaseLabel.setEnabled(flag); sqlDatabaseField.setEnabled(flag); sqlUserLabel.setEnabled(flag); ...
[ "private", "void", "validateSQLFields", "(", ")", "{", "boolean", "flag", "=", "controller", ".", "isEnableSQLDatabaseOutput", "(", ")", ";", "enableSQLDatabaseConnection", ".", "setSelected", "(", "flag", ")", ";", "sqlHostLabel", ".", "setEnabled", "(", "flag", ...
Validates the UNCOMPRESSED Settings.
[ "Validates", "the", "UNCOMPRESSED", "Settings", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/panels/SQLPanel.java#L191-L208
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/DiffTool.java
DiffTool.main
public static void main(final String[] args) { if (args.length != 1) { throw new IllegalArgumentException( "Configuration File ist missing."); } try { // Reads the configuration ConfigSettings config = readConfiguration(args[0]); new DiffToolThread(config).run(); } catch (Exception e) { ...
java
public static void main(final String[] args) { if (args.length != 1) { throw new IllegalArgumentException( "Configuration File ist missing."); } try { // Reads the configuration ConfigSettings config = readConfiguration(args[0]); new DiffToolThread(config).run(); } catch (Exception e) { ...
[ "public", "static", "void", "main", "(", "final", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "!=", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Configuration File ist missing.\"", ")", ";", "}", "try", "{"...
Starts the DiffTool application. @param args program arguments args[0] has to be the path to the configuration file
[ "Starts", "the", "DiffTool", "application", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/DiffTool.java#L45-L62
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/DiffTool.java
DiffTool.readConfiguration
private static ConfigSettings readConfiguration(final String path) throws IOException, SAXException, ParserConfigurationException { ConfigurationReader reader = new ConfigurationReader(path); return reader.read(); }
java
private static ConfigSettings readConfiguration(final String path) throws IOException, SAXException, ParserConfigurationException { ConfigurationReader reader = new ConfigurationReader(path); return reader.read(); }
[ "private", "static", "ConfigSettings", "readConfiguration", "(", "final", "String", "path", ")", "throws", "IOException", ",", "SAXException", ",", "ParserConfigurationException", "{", "ConfigurationReader", "reader", "=", "new", "ConfigurationReader", "(", "path", ")",...
Reads and parses the configuration file. @param path path to the configuration file @return ConfigurationSettings @throws IOException if an error occurred while reading the configuration file @throws SAXException if an error occurred while using the xml parser @throws ParserConfigurationException if the initializatio...
[ "Reads", "and", "parses", "the", "configuration", "file", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/DiffTool.java#L78-L84
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/util/Strings.java
Strings.capitalize
public static String capitalize(String s) { if (Character.isLowerCase(s.charAt(0))) { return Character.toUpperCase(s.charAt(0)) + s.substring(1); } else { return s; } }
java
public static String capitalize(String s) { if (Character.isLowerCase(s.charAt(0))) { return Character.toUpperCase(s.charAt(0)) + s.substring(1); } else { return s; } }
[ "public", "static", "String", "capitalize", "(", "String", "s", ")", "{", "if", "(", "Character", ".", "isLowerCase", "(", "s", ".", "charAt", "(", "0", ")", ")", ")", "{", "return", "Character", ".", "toUpperCase", "(", "s", ".", "charAt", "(", "0",...
Uppercases the first character of a string. @param s a string to capitalize @return a capitalized version of the string
[ "Uppercases", "the", "first", "character", "of", "a", "string", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/util/Strings.java#L70-L76
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/Indexer.java
Indexer.send
private void send() throws IOException, SQLException { this.indexWriter.write(articleIndex); this.indexWriter.write(revisionIndex); this.indexWriter.write(chronoIndex); }
java
private void send() throws IOException, SQLException { this.indexWriter.write(articleIndex); this.indexWriter.write(revisionIndex); this.indexWriter.write(chronoIndex); }
[ "private", "void", "send", "(", ")", "throws", "IOException", ",", "SQLException", "{", "this", ".", "indexWriter", ".", "write", "(", "articleIndex", ")", ";", "this", ".", "indexWriter", ".", "write", "(", "revisionIndex", ")", ";", "this", ".", "indexWr...
Checks whether the AbstractIndex classes have output available and forward them to the output writer. @throws IOException if an error occurred while writing the output @throws SQLException if an error occurred while accessing the database
[ "Checks", "whether", "the", "AbstractIndex", "classes", "have", "output", "available", "and", "forward", "them", "to", "the", "output", "writer", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/Indexer.java#L143-L150
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/Indexer.java
Indexer.index
public void index(final Revision rev) throws WikiApiException { int articleID = rev.getArticleID(); int fullRevisionID = rev.getFullRevisionID(); int revisionCounter = rev.getRevisionCounter(); if (articleID != currentArticleID) { if (lastRev != null) { info.setEndRevisionCount(lastRev.getRevisionC...
java
public void index(final Revision rev) throws WikiApiException { int articleID = rev.getArticleID(); int fullRevisionID = rev.getFullRevisionID(); int revisionCounter = rev.getRevisionCounter(); if (articleID != currentArticleID) { if (lastRev != null) { info.setEndRevisionCount(lastRev.getRevisionC...
[ "public", "void", "index", "(", "final", "Revision", "rev", ")", "throws", "WikiApiException", "{", "int", "articleID", "=", "rev", ".", "getArticleID", "(", ")", ";", "int", "fullRevisionID", "=", "rev", ".", "getFullRevisionID", "(", ")", ";", "int", "re...
Processes the given revision. @param rev Reference to a revision @throws WikiApiException if an error occurs
[ "Processes", "the", "given", "revision", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/Indexer.java#L161-L242
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/Indexer.java
Indexer.close
public void close() throws WikiApiException { try { this.revisionIndex.finalizeIndex(); this.chronoIndex.finalizeIndex(); info.setEndRevisionCount(lastRev.getRevisionCounter()); this.infoList.add(info); this.articleIndex.add(currentArticleID, startTime, endTime, infoList); this.articleInd...
java
public void close() throws WikiApiException { try { this.revisionIndex.finalizeIndex(); this.chronoIndex.finalizeIndex(); info.setEndRevisionCount(lastRev.getRevisionCounter()); this.infoList.add(info); this.articleIndex.add(currentArticleID, startTime, endTime, infoList); this.articleInd...
[ "public", "void", "close", "(", ")", "throws", "WikiApiException", "{", "try", "{", "this", ".", "revisionIndex", ".", "finalizeIndex", "(", ")", ";", "this", ".", "chronoIndex", ".", "finalizeIndex", "(", ")", ";", "info", ".", "setEndRevisionCount", "(", ...
Finalizes the indices and sends the rest of the data to the output. Afterwards the database connection will be closed. @throws WikiApiException if an error occurs
[ "Finalizes", "the", "indices", "and", "sends", "the", "rest", "of", "the", "data", "to", "the", "output", ".", "Afterwards", "the", "database", "connection", "will", "be", "closed", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/Indexer.java#L251-L283
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java
ConfigController.applyConfig
private void applyConfig() { this.components.applyConfig(config); switch (config.getConfigType()) { case DEFAULT: break; case IMPORT: this.archives.applyConfiguration(config); } repaint(); }
java
private void applyConfig() { this.components.applyConfig(config); switch (config.getConfigType()) { case DEFAULT: break; case IMPORT: this.archives.applyConfiguration(config); } repaint(); }
[ "private", "void", "applyConfig", "(", ")", "{", "this", ".", "components", ".", "applyConfig", "(", "config", ")", ";", "switch", "(", "config", ".", "getConfigType", "(", ")", ")", "{", "case", "DEFAULT", ":", "break", ";", "case", "IMPORT", ":", "th...
Applies the configuration file. The input settings will be ignored if a default configuration was used.
[ "Applies", "the", "configuration", "file", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java#L161-L173
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java
ConfigController.createConfigurationXML
public boolean createConfigurationXML() { errors = new ConfigVerification(); xmlConfig = new StringBuilder(); xmlConfig.append("<config>\r\n"); components.toXML(xmlConfig, errors); xmlConfig.append("</config>\r\n"); if (errors.getRowCount() != 0) { // TODO: invoke the dialog at another place new ...
java
public boolean createConfigurationXML() { errors = new ConfigVerification(); xmlConfig = new StringBuilder(); xmlConfig.append("<config>\r\n"); components.toXML(xmlConfig, errors); xmlConfig.append("</config>\r\n"); if (errors.getRowCount() != 0) { // TODO: invoke the dialog at another place new ...
[ "public", "boolean", "createConfigurationXML", "(", ")", "{", "errors", "=", "new", "ConfigVerification", "(", ")", ";", "xmlConfig", "=", "new", "StringBuilder", "(", ")", ";", "xmlConfig", ".", "append", "(", "\"<config>\\r\\n\"", ")", ";", "components", "."...
Creates the xml content representation of the currently used settings. @return TRUE if the ConfigVerfication contains no items, FALSE otherwise
[ "Creates", "the", "xml", "content", "representation", "of", "the", "currently", "used", "settings", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java#L180-L199
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java
ConfigController.loadConfiguration
public void loadConfiguration() { XMLFileChooser fc = new XMLFileChooser(); if (fc.showOpenDialog(new JPanel()) == XMLFileChooser.APPROVE_OPTION) { this.loadConfig(fc.getSelectedFile().getPath()); } }
java
public void loadConfiguration() { XMLFileChooser fc = new XMLFileChooser(); if (fc.showOpenDialog(new JPanel()) == XMLFileChooser.APPROVE_OPTION) { this.loadConfig(fc.getSelectedFile().getPath()); } }
[ "public", "void", "loadConfiguration", "(", ")", "{", "XMLFileChooser", "fc", "=", "new", "XMLFileChooser", "(", ")", ";", "if", "(", "fc", ".", "showOpenDialog", "(", "new", "JPanel", "(", ")", ")", "==", "XMLFileChooser", ".", "APPROVE_OPTION", ")", "{",...
Loads the configuration file. The path of the file will be chosen by displaying a FileChooser Dialog.
[ "Loads", "the", "configuration", "file", ".", "The", "path", "of", "the", "file", "will", "be", "chosen", "by", "displaying", "a", "FileChooser", "Dialog", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java#L366-L373
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java
ConfigController.saveConfiguration
public void saveConfiguration() { if (this.createConfigurationXML()) { XMLFileChooser fc = new XMLFileChooser(); if (fc.showSaveDialog(new JPanel()) == XMLFileChooser.APPROVE_OPTION) { String path = fc.getSelectedFile().getPath(); if (path.indexOf('.') == -1) { path += ".xml"; } if (th...
java
public void saveConfiguration() { if (this.createConfigurationXML()) { XMLFileChooser fc = new XMLFileChooser(); if (fc.showSaveDialog(new JPanel()) == XMLFileChooser.APPROVE_OPTION) { String path = fc.getSelectedFile().getPath(); if (path.indexOf('.') == -1) { path += ".xml"; } if (th...
[ "public", "void", "saveConfiguration", "(", ")", "{", "if", "(", "this", ".", "createConfigurationXML", "(", ")", ")", "{", "XMLFileChooser", "fc", "=", "new", "XMLFileChooser", "(", ")", ";", "if", "(", "fc", ".", "showSaveDialog", "(", "new", "JPanel", ...
Saves the configuration file. The path of the file will be chosen by displaying a FileChooser Dialog.
[ "Saves", "the", "configuration", "file", ".", "The", "path", "of", "the", "file", "will", "be", "chosen", "by", "displaying", "a", "FileChooser", "Dialog", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java#L411-L434
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java
ConfigController.saveConfiguration
public boolean saveConfiguration(final String path) { if (xmlConfig != null && !errors.hasFailed()) { boolean success = true; FileWriter writer = null; try { writer = new FileWriter(path); writer.write(xmlConfig.toString()); writer.flush(); } catch (IOException ioe) { ioe.printStac...
java
public boolean saveConfiguration(final String path) { if (xmlConfig != null && !errors.hasFailed()) { boolean success = true; FileWriter writer = null; try { writer = new FileWriter(path); writer.write(xmlConfig.toString()); writer.flush(); } catch (IOException ioe) { ioe.printStac...
[ "public", "boolean", "saveConfiguration", "(", "final", "String", "path", ")", "{", "if", "(", "xmlConfig", "!=", "null", "&&", "!", "errors", ".", "hasFailed", "(", ")", ")", "{", "boolean", "success", "=", "true", ";", "FileWriter", "writer", "=", "nul...
Save the configuration to a file. @param path output path @return TRUE if the configuration was succesfully exported FALSE otherwise
[ "Save", "the", "configuration", "to", "a", "file", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java#L444-L477
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java
ConfigController.setEnable7Zip
public void setEnable7Zip(final boolean enable7Zip) { this.enable7Zip = enable7Zip; if (!this.enable7Zip) { if (outputCompression == OutputCompressionEnum.SevenZip) { outputCompression = OutputCompressionEnum.None; } } }
java
public void setEnable7Zip(final boolean enable7Zip) { this.enable7Zip = enable7Zip; if (!this.enable7Zip) { if (outputCompression == OutputCompressionEnum.SevenZip) { outputCompression = OutputCompressionEnum.None; } } }
[ "public", "void", "setEnable7Zip", "(", "final", "boolean", "enable7Zip", ")", "{", "this", ".", "enable7Zip", "=", "enable7Zip", ";", "if", "(", "!", "this", ".", "enable7Zip", ")", "{", "if", "(", "outputCompression", "==", "OutputCompressionEnum", ".", "S...
Enables or disables the 7Zip support. If the support is disabled the and the OutputCompression Mode was 7Zip the Mode will be reseted to None. @param enable7Zip 7Zip support flag
[ "Enables", "or", "disables", "the", "7Zip", "support", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigController.java#L489-L497
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CycleHandler.java
CycleHandler.removeCycles
public void removeCycles() throws WikiApiException { DefaultEdge edge = null; while ((edge = findCycle()) != null) { Category sourceCat = wiki.getCategory(categoryGraph.getGraph().getEdgeSource(edge)); Category targetCat = wiki.getCategory(categoryGraph.getGraph().getEdgeTarget(e...
java
public void removeCycles() throws WikiApiException { DefaultEdge edge = null; while ((edge = findCycle()) != null) { Category sourceCat = wiki.getCategory(categoryGraph.getGraph().getEdgeSource(edge)); Category targetCat = wiki.getCategory(categoryGraph.getGraph().getEdgeTarget(e...
[ "public", "void", "removeCycles", "(", ")", "throws", "WikiApiException", "{", "DefaultEdge", "edge", "=", "null", ";", "while", "(", "(", "edge", "=", "findCycle", "(", ")", ")", "!=", "null", ")", "{", "Category", "sourceCat", "=", "wiki", ".", "getCat...
Removes cycles from the graph that was used to construct the cycle handler. @throws WikiApiException Thrown if errors occurred.
[ "Removes", "cycles", "from", "the", "graph", "that", "was", "used", "to", "construct", "the", "cycle", "handler", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CycleHandler.java#L254-L264
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/decompression/UniversalDecompressor.java
UniversalDecompressor.loadExternal
private void loadExternal() { Properties properties = new Properties(); try { properties.loadFromXML(new FileInputStream(PROPERTIES_PATH)); for (String key : properties.stringPropertyNames()) { externalSupport.put(key, properties.getProperty(key)); } } catch (IOException ignore) { } }
java
private void loadExternal() { Properties properties = new Properties(); try { properties.loadFromXML(new FileInputStream(PROPERTIES_PATH)); for (String key : properties.stringPropertyNames()) { externalSupport.put(key, properties.getProperty(key)); } } catch (IOException ignore) { } }
[ "private", "void", "loadExternal", "(", ")", "{", "Properties", "properties", "=", "new", "Properties", "(", ")", ";", "try", "{", "properties", ".", "loadFromXML", "(", "new", "FileInputStream", "(", "PROPERTIES_PATH", ")", ")", ";", "for", "(", "String", ...
Load the properties for external utilities from a XML file
[ "Load", "the", "properties", "for", "external", "utilities", "from", "a", "XML", "file" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/decompression/UniversalDecompressor.java#L106-L115
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/decompression/UniversalDecompressor.java
UniversalDecompressor.getExtension
private String getExtension(String fileName) { if (fileName == null) { return null; } String ext = null; int i = fileName.lastIndexOf('.'); if (i > 0 && i < fileName.length() - 1) { ext = fileName.substring(i + 1).toLowerCase(); } return ext; }
java
private String getExtension(String fileName) { if (fileName == null) { return null; } String ext = null; int i = fileName.lastIndexOf('.'); if (i > 0 && i < fileName.length() - 1) { ext = fileName.substring(i + 1).toLowerCase(); } return ext; }
[ "private", "String", "getExtension", "(", "String", "fileName", ")", "{", "if", "(", "fileName", "==", "null", ")", "{", "return", "null", ";", "}", "String", "ext", "=", "null", ";", "int", "i", "=", "fileName", ".", "lastIndexOf", "(", "'", "'", ")...
Return the extension of the filename @param fileName that should be inputed @return file extension or null
[ "Return", "the", "extension", "of", "the", "filename" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/decompression/UniversalDecompressor.java#L124-L136
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/decompression/UniversalDecompressor.java
UniversalDecompressor.isSupported
public boolean isSupported(String fileName) { String extension = getExtension(fileName); return isInternalSupported(extension) || isExternalSupported(extension); }
java
public boolean isSupported(String fileName) { String extension = getExtension(fileName); return isInternalSupported(extension) || isExternalSupported(extension); }
[ "public", "boolean", "isSupported", "(", "String", "fileName", ")", "{", "String", "extension", "=", "getExtension", "(", "fileName", ")", ";", "return", "isInternalSupported", "(", "extension", ")", "||", "isExternalSupported", "(", "extension", ")", ";", "}" ]
Check if the file is supported by the internal or external decompressor @param fileName @return true if the file extension is supported
[ "Check", "if", "the", "file", "is", "supported", "by", "the", "internal", "or", "external", "decompressor" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/decompression/UniversalDecompressor.java#L144-L148
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/decompression/UniversalDecompressor.java
UniversalDecompressor.startExternal
private InputStream startExternal(String fileName) { InputStream result = null; try { String extension = getExtension(fileName); String command = externalSupport.get(extension).replace( FILEPLACEHOLDER, fileName); Process externalProcess = Runtime.getRuntime().exec(command); result = externalProces...
java
private InputStream startExternal(String fileName) { InputStream result = null; try { String extension = getExtension(fileName); String command = externalSupport.get(extension).replace( FILEPLACEHOLDER, fileName); Process externalProcess = Runtime.getRuntime().exec(command); result = externalProces...
[ "private", "InputStream", "startExternal", "(", "String", "fileName", ")", "{", "InputStream", "result", "=", "null", ";", "try", "{", "String", "extension", "=", "getExtension", "(", "fileName", ")", ";", "String", "command", "=", "externalSupport", ".", "get...
Start an external utility to unpack the the archive @param fileName @return InputStream to read the decompressed data
[ "Start", "an", "external", "utility", "to", "unpack", "the", "the", "archive" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/decompression/UniversalDecompressor.java#L156-L167
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/decompression/UniversalDecompressor.java
UniversalDecompressor.getDefault
private InputStream getDefault(String fileName) { InputStream result = null; try { result = new BufferedInputStream(new FileInputStream(fileName)); } catch (IOException ignore) { } return result; }
java
private InputStream getDefault(String fileName) { InputStream result = null; try { result = new BufferedInputStream(new FileInputStream(fileName)); } catch (IOException ignore) { } return result; }
[ "private", "InputStream", "getDefault", "(", "String", "fileName", ")", "{", "InputStream", "result", "=", "null", ";", "try", "{", "result", "=", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "fileName", ")", ")", ";", "}", "catch", "(",...
Get default InputStream to read the data from the file @param fileName @return FileInputStream(fileName)
[ "Get", "default", "InputStream", "to", "read", "the", "data", "from", "the", "file" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/decompression/UniversalDecompressor.java#L175-L183
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateFilter.java
TemplateFilter.isInWhiteList
private boolean isInWhiteList(String tpl) { if ((!whiteList.isEmpty() && whiteList.contains(tpl)) || (whiteList.isEmpty())) { return true; } return false; }
java
private boolean isInWhiteList(String tpl) { if ((!whiteList.isEmpty() && whiteList.contains(tpl)) || (whiteList.isEmpty())) { return true; } return false; }
[ "private", "boolean", "isInWhiteList", "(", "String", "tpl", ")", "{", "if", "(", "(", "!", "whiteList", ".", "isEmpty", "(", ")", "&&", "whiteList", ".", "contains", "(", "tpl", ")", ")", "||", "(", "whiteList", ".", "isEmpty", "(", ")", ")", ")", ...
Checks if the input string is in white list @param tpl string to check @return
[ "Checks", "if", "the", "input", "string", "is", "in", "white", "list" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateFilter.java#L65-L72
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateFilter.java
TemplateFilter.containsAllowedPrefix
private boolean containsAllowedPrefix(String tpl) { if (whitePrefixList.isEmpty()) return true; for (String i : whitePrefixList) { if (tpl.startsWith(i)) return true; } return false; }
java
private boolean containsAllowedPrefix(String tpl) { if (whitePrefixList.isEmpty()) return true; for (String i : whitePrefixList) { if (tpl.startsWith(i)) return true; } return false; }
[ "private", "boolean", "containsAllowedPrefix", "(", "String", "tpl", ")", "{", "if", "(", "whitePrefixList", ".", "isEmpty", "(", ")", ")", "return", "true", ";", "for", "(", "String", "i", ":", "whitePrefixList", ")", "{", "if", "(", "tpl", ".", "starts...
Checks if the input string contains prefixes from white list @param tpl string to check @return
[ "Checks", "if", "the", "input", "string", "contains", "prefixes", "from", "white", "list" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateFilter.java#L96-L106
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateFilter.java
TemplateFilter.containsRestrictedPrefix
private boolean containsRestrictedPrefix(String tpl) { for (String i : blackPrefixList) { if (tpl.startsWith(i)) return true; } return false; }
java
private boolean containsRestrictedPrefix(String tpl) { for (String i : blackPrefixList) { if (tpl.startsWith(i)) return true; } return false; }
[ "private", "boolean", "containsRestrictedPrefix", "(", "String", "tpl", ")", "{", "for", "(", "String", "i", ":", "blackPrefixList", ")", "{", "if", "(", "tpl", ".", "startsWith", "(", "i", ")", ")", "return", "true", ";", "}", "return", "false", ";", ...
Checks if the input string contains prefixes from black list @param tpl string to check @return
[ "Checks", "if", "the", "input", "string", "contains", "prefixes", "from", "black", "list" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateFilter.java#L115-L122
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateFilter.java
TemplateFilter.acceptTemplate
public boolean acceptTemplate(String tpl) { if (isInWhiteList(tpl) && !isInBlackList(tpl)) { if (containsAllowedPrefix(tpl) && !containsRestrictedPrefix(tpl)) { return true; } else { return false; } } else { return false; } }
java
public boolean acceptTemplate(String tpl) { if (isInWhiteList(tpl) && !isInBlackList(tpl)) { if (containsAllowedPrefix(tpl) && !containsRestrictedPrefix(tpl)) { return true; } else { return false; } } else { return false; } }
[ "public", "boolean", "acceptTemplate", "(", "String", "tpl", ")", "{", "if", "(", "isInWhiteList", "(", "tpl", ")", "&&", "!", "isInBlackList", "(", "tpl", ")", ")", "{", "if", "(", "containsAllowedPrefix", "(", "tpl", ")", "&&", "!", "containsRestrictedPr...
Checks whether to include the template with the given name in the database or not. @param tpl the template name @return true, if the template should be included in the db
[ "Checks", "whether", "to", "include", "the", "template", "with", "the", "given", "name", "in", "the", "database", "or", "not", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateFilter.java#L132-L147
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/RevisionIndex.java
RevisionIndex.add
public void add(final int revisionID, final long revisionPrimaryKey, final long fullRevisionPrimaryKey) { boolean sql = !insertStatement.isEmpty(); if (sql&&buffer.length() != insertStatement.length()) { this.buffer.append(","); } this.buffer.append((sql?"(":"") + revisionID + "," + revisionPrimaryKey ...
java
public void add(final int revisionID, final long revisionPrimaryKey, final long fullRevisionPrimaryKey) { boolean sql = !insertStatement.isEmpty(); if (sql&&buffer.length() != insertStatement.length()) { this.buffer.append(","); } this.buffer.append((sql?"(":"") + revisionID + "," + revisionPrimaryKey ...
[ "public", "void", "add", "(", "final", "int", "revisionID", ",", "final", "long", "revisionPrimaryKey", ",", "final", "long", "fullRevisionPrimaryKey", ")", "{", "boolean", "sql", "=", "!", "insertStatement", ".", "isEmpty", "(", ")", ";", "if", "(", "sql", ...
Adds the information for an new entry in the revision index. @param revisionID ID of the revision @param revisionPrimaryKey PK of the revison @param fullRevisionPrimaryKey PK of the related full revison
[ "Adds", "the", "information", "for", "an", "new", "entry", "in", "the", "revision", "index", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/RevisionIndex.java#L62-L81
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getFirstRevisionPK
public int getFirstRevisionPK(final int articleID) throws WikiApiException { try { if (articleID < 1) { throw new IllegalArgumentException(); } PreparedStatement statement = null; ResultSet result = null; String firstRevPK...
java
public int getFirstRevisionPK(final int articleID) throws WikiApiException { try { if (articleID < 1) { throw new IllegalArgumentException(); } PreparedStatement statement = null; ResultSet result = null; String firstRevPK...
[ "public", "int", "getFirstRevisionPK", "(", "final", "int", "articleID", ")", "throws", "WikiApiException", "{", "try", "{", "if", "(", "articleID", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "PreparedStatement", "state...
Returns the PrimaryKey for the first revision of the given article @param articleID ID of the article @return PK of the first revision @throws WikiApiException if an error occurs
[ "Returns", "the", "PrimaryKey", "for", "the", "first", "revision", "of", "the", "given", "article" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L184-L232
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getNumberOfRevisions
public int getNumberOfRevisions(final int articleID) throws WikiApiException { try { if (articleID < 1) { throw new IllegalArgumentException(); } PreparedStatement statement = null; ResultSet result = null; String revCount...
java
public int getNumberOfRevisions(final int articleID) throws WikiApiException { try { if (articleID < 1) { throw new IllegalArgumentException(); } PreparedStatement statement = null; ResultSet result = null; String revCount...
[ "public", "int", "getNumberOfRevisions", "(", "final", "int", "articleID", ")", "throws", "WikiApiException", "{", "try", "{", "if", "(", "articleID", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "PreparedStatement", "sta...
Returns the number of revisions for the specified article. @param articleID ID of the article @return number of revisions @throws WikiApiException if an error occurs
[ "Returns", "the", "number", "of", "revisions", "for", "the", "specified", "article", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L245-L298
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getRevisionTimestamps
public List<Timestamp> getRevisionTimestamps(final int articleID) throws WikiApiException { List<Timestamp> timestamps = new LinkedList<Timestamp>(); try { if (articleID < 1) { throw new IllegalArgumentException(); } PreparedStatement st...
java
public List<Timestamp> getRevisionTimestamps(final int articleID) throws WikiApiException { List<Timestamp> timestamps = new LinkedList<Timestamp>(); try { if (articleID < 1) { throw new IllegalArgumentException(); } PreparedStatement st...
[ "public", "List", "<", "Timestamp", ">", "getRevisionTimestamps", "(", "final", "int", "articleID", ")", "throws", "WikiApiException", "{", "List", "<", "Timestamp", ">", "timestamps", "=", "new", "LinkedList", "<", "Timestamp", ">", "(", ")", ";", "try", "{...
Returns the timestamps of all revisions connected to the specified article. In order to make this query fast, create a MySQL-Index (BTREE) on the ArticleID in the revisions-table. @param articleID ID of the article @return collection of timestampf of all revisions @throws WikiApiException if an error occurs
[ "Returns", "the", "timestamps", "of", "all", "revisions", "connected", "to", "the", "specified", "article", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L439-L494
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getNumberOfUniqueContributorsBeforeRevision
public int getNumberOfUniqueContributorsBeforeRevision(final int revisionID, boolean onlyRegistered) throws WikiApiException { try { if (revisionID < 1) { throw new IllegalArgumentException(); } int articleID = getPageIdForRevisionId(...
java
public int getNumberOfUniqueContributorsBeforeRevision(final int revisionID, boolean onlyRegistered) throws WikiApiException { try { if (revisionID < 1) { throw new IllegalArgumentException(); } int articleID = getPageIdForRevisionId(...
[ "public", "int", "getNumberOfUniqueContributorsBeforeRevision", "(", "final", "int", "revisionID", ",", "boolean", "onlyRegistered", ")", "throws", "WikiApiException", "{", "try", "{", "if", "(", "revisionID", "<", "1", ")", "{", "throw", "new", "IllegalArgumentExce...
Returns the number of unique contributors to an article that have contributed before the given revision. In order to make this query fast, create a MySQL-Index (BTREE) on the ArticleID in the revisions-table. @param revisionID revision before which to count the contributors @param onlyRegistered defines whether to co...
[ "Returns", "the", "number", "of", "unique", "contributors", "to", "an", "article", "that", "have", "contributed", "before", "the", "given", "revision", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L632-L697
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getUserContributionMap
public Map<String, Timestamp> getUserContributionMap(final int articleID, String[] groupfilter) throws WikiApiException { return getUserContributionMap(articleID, groupfilter, false); }
java
public Map<String, Timestamp> getUserContributionMap(final int articleID, String[] groupfilter) throws WikiApiException { return getUserContributionMap(articleID, groupfilter, false); }
[ "public", "Map", "<", "String", ",", "Timestamp", ">", "getUserContributionMap", "(", "final", "int", "articleID", ",", "String", "[", "]", "groupfilter", ")", "throws", "WikiApiException", "{", "return", "getUserContributionMap", "(", "articleID", ",", "groupfilt...
Returns a map of usernames mapped to the timestamps of their contributions. Users of certain user groups (e.g. bots) can be filtered by providing the unwanted groups in the {@code groupFilter}. Nothing is filtered if the {@code groupFilter} is {@code null} or empty.<br> <br> Filtered results also include unregistered ...
[ "Returns", "a", "map", "of", "usernames", "mapped", "to", "the", "timestamps", "of", "their", "contributions", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L740-L744
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getUserGroups
public List<String> getUserGroups(final int userID) throws WikiApiException { List<String> groups = new LinkedList<String>(); try { if (userID < 1) { throw new IllegalArgumentException(); } if (!tableExists("user_groups")) { ...
java
public List<String> getUserGroups(final int userID) throws WikiApiException { List<String> groups = new LinkedList<String>(); try { if (userID < 1) { throw new IllegalArgumentException(); } if (!tableExists("user_groups")) { ...
[ "public", "List", "<", "String", ">", "getUserGroups", "(", "final", "int", "userID", ")", "throws", "WikiApiException", "{", "List", "<", "String", ">", "groups", "=", "new", "LinkedList", "<", "String", ">", "(", ")", ";", "try", "{", "if", "(", "use...
Returns the group assignments of the specified user @param userID ID of the user (NOT THE USERNAME) @return collection of user groups @throws WikiApiException if an error occurs
[ "Returns", "the", "group", "assignments", "of", "the", "specified", "user" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L869-L923
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getUserRevisionIds
public Map<Integer, List<Integer>> getUserRevisionIds(int userid) throws WikiApiException { Map<Integer, List<Integer>> revIds = new HashMap<Integer, List<Integer>>(); try { if (userid < 1) { throw new IllegalArgumentException(); } if (!...
java
public Map<Integer, List<Integer>> getUserRevisionIds(int userid) throws WikiApiException { Map<Integer, List<Integer>> revIds = new HashMap<Integer, List<Integer>>(); try { if (userid < 1) { throw new IllegalArgumentException(); } if (!...
[ "public", "Map", "<", "Integer", ",", "List", "<", "Integer", ">", ">", "getUserRevisionIds", "(", "int", "userid", ")", "throws", "WikiApiException", "{", "Map", "<", "Integer", ",", "List", "<", "Integer", ">", ">", "revIds", "=", "new", "HashMap", "<"...
Returns the revisionids of all revisions created by given user @param userid id of the user (NOT USER NAME) @return list of revision ids @throws WikiApiException if an error occurs
[ "Returns", "the", "revisionids", "of", "all", "revisions", "created", "by", "given", "user" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L935-L996
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getTimestampToRevisionMap
public Map<Timestamp, Collection<DiffPart>> getTimestampToRevisionMap(final int articleID) throws WikiApiException { Map<Timestamp, Collection<DiffPart>> tsDiffPartsMap = new HashMap<Timestamp, Collection<DiffPart>>(); try { if (articleID < 1) { throw new Illega...
java
public Map<Timestamp, Collection<DiffPart>> getTimestampToRevisionMap(final int articleID) throws WikiApiException { Map<Timestamp, Collection<DiffPart>> tsDiffPartsMap = new HashMap<Timestamp, Collection<DiffPart>>(); try { if (articleID < 1) { throw new Illega...
[ "public", "Map", "<", "Timestamp", ",", "Collection", "<", "DiffPart", ">", ">", "getTimestampToRevisionMap", "(", "final", "int", "articleID", ")", "throws", "WikiApiException", "{", "Map", "<", "Timestamp", ",", "Collection", "<", "DiffPart", ">", ">", "tsDi...
Returns a map of timestamps mapped on the corresponding DiffPart-Collections. Can be used to compile statistics over all changes that have been made in one article. In order to make this query fast, create a MySQL-Index (BTREE) on the ArticleID in the revisions-table. @param articleID ID of the article @return map of...
[ "Returns", "a", "map", "of", "timestamps", "mapped", "on", "the", "corresponding", "DiffPart", "-", "Collections", ".", "Can", "be", "used", "to", "compile", "statistics", "over", "all", "changes", "that", "have", "been", "made", "in", "one", "article", "." ...
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1087-L1162
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getDateOfAppearance
private Timestamp getDateOfAppearance(final int articleID, final String firstOrLast) throws WikiApiException { try { if (articleID < 1) { throw new IllegalArgumentException(); } PreparedStatement statement = null; ResultSet result = n...
java
private Timestamp getDateOfAppearance(final int articleID, final String firstOrLast) throws WikiApiException { try { if (articleID < 1) { throw new IllegalArgumentException(); } PreparedStatement statement = null; ResultSet result = n...
[ "private", "Timestamp", "getDateOfAppearance", "(", "final", "int", "articleID", ",", "final", "String", "firstOrLast", ")", "throws", "WikiApiException", "{", "try", "{", "if", "(", "articleID", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(...
Returns the timestamp of the first or last revision connected to the specified article. @param articleID ID of the article @param firstOrLast <code>"FirstAppearance"</code> if first date of appearance should be returned. <code>"LastAppearance"</code> if last date of appearance should be returned. @return first date o...
[ "Returns", "the", "timestamp", "of", "the", "first", "or", "last", "revision", "connected", "to", "the", "specified", "article", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1210-L1257
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getRevision
public Revision getRevision(final int revisionID) throws WikiApiException { try { if (revisionID < 1) { throw new IllegalArgumentException(); } int fullRevPK = -1; int limit = 1; PreparedStatement statement = null; ...
java
public Revision getRevision(final int revisionID) throws WikiApiException { try { if (revisionID < 1) { throw new IllegalArgumentException(); } int fullRevPK = -1; int limit = 1; PreparedStatement statement = null; ...
[ "public", "Revision", "getRevision", "(", "final", "int", "revisionID", ")", "throws", "WikiApiException", "{", "try", "{", "if", "(", "revisionID", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "int", "fullRevPK", "=", ...
Returns the by the id specified revision. @param revisionID ID of the revision @return Revision @throws WikiApiException if an error occurs or the revision does not exists.
[ "Returns", "the", "by", "the", "id", "specified", "revision", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1269-L1319
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getRevision
public Revision getRevision(final int articleID, final int revisionCounter) throws WikiApiException { try { if (articleID < 1 || revisionCounter < 1) { throw new IllegalArgumentException(); } int revisionIndex = checkMapping(articleID, revisionCo...
java
public Revision getRevision(final int articleID, final int revisionCounter) throws WikiApiException { try { if (articleID < 1 || revisionCounter < 1) { throw new IllegalArgumentException(); } int revisionIndex = checkMapping(articleID, revisionCo...
[ "public", "Revision", "getRevision", "(", "final", "int", "articleID", ",", "final", "int", "revisionCounter", ")", "throws", "WikiApiException", "{", "try", "{", "if", "(", "articleID", "<", "1", "||", "revisionCounter", "<", "1", ")", "{", "throw", "new", ...
Returns the by the article ID and revisionCounter specified revision. Note that this method returns the revision in chronological order. @param articleID ID of the article @param revisionCounter number of revision @return Revision @throws WikiApiException if an error occurs or the revision does not exists.
[ "Returns", "the", "by", "the", "article", "ID", "and", "revisionCounter", "specified", "revision", ".", "Note", "that", "this", "method", "returns", "the", "revision", "in", "chronological", "order", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1394-L1444
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getRevision
public Revision getRevision(final int articleID, final Timestamp time) throws WikiApiException { try { PreparedStatement statement = null; ResultSet result = null; String fullRevisions; String revisionCounters; if (articleID < 1 || time ...
java
public Revision getRevision(final int articleID, final Timestamp time) throws WikiApiException { try { PreparedStatement statement = null; ResultSet result = null; String fullRevisions; String revisionCounters; if (articleID < 1 || time ...
[ "public", "Revision", "getRevision", "(", "final", "int", "articleID", ",", "final", "Timestamp", "time", ")", "throws", "WikiApiException", "{", "try", "{", "PreparedStatement", "statement", "=", "null", ";", "ResultSet", "result", "=", "null", ";", "String", ...
Returns the by the article ID and timestamp specified revision. Note that the timestamp is not an unique identifier of a revision related to an article. The returned revision should be the first revision that can be found inside the database. @param articleID ID of the article @param time Timestamp @return Revision @...
[ "Returns", "the", "by", "the", "article", "ID", "and", "timestamp", "specified", "revision", ".", "Note", "that", "the", "timestamp", "is", "not", "an", "unique", "identifier", "of", "a", "revision", "related", "to", "an", "article", ".", "The", "returned", ...
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1460-L1556
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.checkMapping
protected int checkMapping(final int articleID, final int revisionCounter) throws SQLException { PreparedStatement statement = null; ResultSet result = null; // Check for the correct revisionCounter mapping try { statement = this.connection.prepareStatement("SEL...
java
protected int checkMapping(final int articleID, final int revisionCounter) throws SQLException { PreparedStatement statement = null; ResultSet result = null; // Check for the correct revisionCounter mapping try { statement = this.connection.prepareStatement("SEL...
[ "protected", "int", "checkMapping", "(", "final", "int", "articleID", ",", "final", "int", "revisionCounter", ")", "throws", "SQLException", "{", "PreparedStatement", "statement", "=", "null", ";", "ResultSet", "result", "=", "null", ";", "// Check for the correct r...
This method maps the chronological order to the revisionCounter. @param articleID ID of the article @param revisionCounter chronological position @return position in the chronological order @throws SQLException if an error occurs while accesing the database.
[ "This", "method", "maps", "the", "chronological", "order", "to", "the", "revisionCounter", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1575-L1606
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getMapping
private int getMapping(final String mapping, final int revisionCounter) { String tempA, tempB; int length = 0; int revC = -1, mapC = -1; int index, max = mapping.length(); while (length < max && revC < revisionCounter) { // Read revisionCounter ind...
java
private int getMapping(final String mapping, final int revisionCounter) { String tempA, tempB; int length = 0; int revC = -1, mapC = -1; int index, max = mapping.length(); while (length < max && revC < revisionCounter) { // Read revisionCounter ind...
[ "private", "int", "getMapping", "(", "final", "String", "mapping", ",", "final", "int", "revisionCounter", ")", "{", "String", "tempA", ",", "tempB", ";", "int", "length", "=", "0", ";", "int", "revC", "=", "-", "1", ",", "mapC", "=", "-", "1", ";", ...
This method returns the correct mapping of the given input. @param mapping mapping sequence @param revisionCounter index to map @return mapped index
[ "This", "method", "returns", "the", "correct", "mapping", "of", "the", "given", "input", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1666-L1703
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.getReferencedRevision
private Revision getReferencedRevision(final int articleID, final int revisionIndex, final String fullRevisions, final String revCounters) throws WikiApiException { try { int fullRevPK = -1; int limit = 1; String fullRev = null; int revA...
java
private Revision getReferencedRevision(final int articleID, final int revisionIndex, final String fullRevisions, final String revCounters) throws WikiApiException { try { int fullRevPK = -1; int limit = 1; String fullRev = null; int revA...
[ "private", "Revision", "getReferencedRevision", "(", "final", "int", "articleID", ",", "final", "int", "revisionIndex", ",", "final", "String", "fullRevisions", ",", "final", "String", "revCounters", ")", "throws", "WikiApiException", "{", "try", "{", "int", "full...
This method identifies the correct full revision and retrieves the reference revision. @param articleID ID of the article @param revisionIndex number of revision @param fullRevisions list of full revisions @param revCounters list of revision counters @return Revision @throws WikiApiException if an error occurs
[ "This", "method", "identifies", "the", "correct", "full", "revision", "and", "retrieves", "the", "reference", "revision", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1721-L1781
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java
RevisionApi.indexExists
private boolean indexExists(String table, String indexName) throws SQLException { PreparedStatement statement = null; ResultSet result = null; try { statement = this.connection.prepareStatement("SHOW INDEX FROM " + table + " WHERE Key_name!= 'PRIMARY'...
java
private boolean indexExists(String table, String indexName) throws SQLException { PreparedStatement statement = null; ResultSet result = null; try { statement = this.connection.prepareStatement("SHOW INDEX FROM " + table + " WHERE Key_name!= 'PRIMARY'...
[ "private", "boolean", "indexExists", "(", "String", "table", ",", "String", "indexName", ")", "throws", "SQLException", "{", "PreparedStatement", "statement", "=", "null", ";", "ResultSet", "result", "=", "null", ";", "try", "{", "statement", "=", "this", ".",...
Checks if an index with a specific name exists in a given table. @param table the table to check @param indexName the name of the index (may be null) @return {@code true} if index exists, false else @throws SQLException if an error occurs connecting to or querying the db
[ "Checks", "if", "an", "index", "with", "a", "specific", "name", "exists", "in", "a", "given", "table", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L2078-L2129
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/HibernateUtilities.java
HibernateUtilities.getIdMappingCategories
public Map<Integer, Long> getIdMappingCategories() { Map<Integer, Long> idMapping = new HashMap<Integer, Long>(); Session session = WikiHibernateUtil.getSessionFactory(this.dbConfig).getCurrentSession(); session.beginTransaction(); Iterator results = session.createQuery("select cat.id, ...
java
public Map<Integer, Long> getIdMappingCategories() { Map<Integer, Long> idMapping = new HashMap<Integer, Long>(); Session session = WikiHibernateUtil.getSessionFactory(this.dbConfig).getCurrentSession(); session.beginTransaction(); Iterator results = session.createQuery("select cat.id, ...
[ "public", "Map", "<", "Integer", ",", "Long", ">", "getIdMappingCategories", "(", ")", "{", "Map", "<", "Integer", ",", "Long", ">", "idMapping", "=", "new", "HashMap", "<", "Integer", ",", "Long", ">", "(", ")", ";", "Session", "session", "=", "WikiHi...
Hibernate IDs are needed to load an object from the database. Internal references are via pageIDs. @return A mapping of pageIDs to hibernate IDs.
[ "Hibernate", "IDs", "are", "needed", "to", "load", "an", "object", "from", "the", "database", ".", "Internal", "references", "are", "via", "pageIDs", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/HibernateUtilities.java#L61-L74
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffCalculator.java
DiffCalculator.init
private void init(final Task<Revision> task) { this.partCounter++; this.result = new Task<Diff>(task.getHeader(), partCounter); }
java
private void init(final Task<Revision> task) { this.partCounter++; this.result = new Task<Diff>(task.getHeader(), partCounter); }
[ "private", "void", "init", "(", "final", "Task", "<", "Revision", ">", "task", ")", "{", "this", ".", "partCounter", "++", ";", "this", ".", "result", "=", "new", "Task", "<", "Diff", ">", "(", "task", ".", "getHeader", "(", ")", ",", "partCounter", ...
Initializes the processing of a RevisionTask using a new DiffTask. @param task Reference to the DiffTask
[ "Initializes", "the", "processing", "of", "a", "RevisionTask", "using", "a", "new", "DiffTask", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffCalculator.java#L219-L223
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffCalculator.java
DiffCalculator.initNewTask
protected void initNewTask(final int taskID) { this.articleID = taskID; this.partCounter = 0; this.revisionCounter = 0; this.revPrevious = null; this.revCurrent = null; }
java
protected void initNewTask(final int taskID) { this.articleID = taskID; this.partCounter = 0; this.revisionCounter = 0; this.revPrevious = null; this.revCurrent = null; }
[ "protected", "void", "initNewTask", "(", "final", "int", "taskID", ")", "{", "this", ".", "articleID", "=", "taskID", ";", "this", ".", "partCounter", "=", "0", ";", "this", ".", "revisionCounter", "=", "0", ";", "this", ".", "revPrevious", "=", "null", ...
Initializes the processing of a new RevisionTask. @param taskID Article ID
[ "Initializes", "the", "processing", "of", "a", "new", "RevisionTask", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffCalculator.java#L231-L241
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffCalculator.java
DiffCalculator.generateFullRevision
private Diff generateFullRevision(final Revision revision) throws UnsupportedEncodingException { Diff diff = new Diff(); RevisionCodecData codecData = new RevisionCodecData(); // FullRevisionUncompressed (C L T) part = new DiffPart(DiffAction.FULL_REVISION_UNCOMPRESSED); // L T text = revision.getRevi...
java
private Diff generateFullRevision(final Revision revision) throws UnsupportedEncodingException { Diff diff = new Diff(); RevisionCodecData codecData = new RevisionCodecData(); // FullRevisionUncompressed (C L T) part = new DiffPart(DiffAction.FULL_REVISION_UNCOMPRESSED); // L T text = revision.getRevi...
[ "private", "Diff", "generateFullRevision", "(", "final", "Revision", "revision", ")", "throws", "UnsupportedEncodingException", "{", "Diff", "diff", "=", "new", "Diff", "(", ")", ";", "RevisionCodecData", "codecData", "=", "new", "RevisionCodecData", "(", ")", ";"...
Generates a FullRevision. @param revision Reference to the revision @return Diff, containing a FullRevision @throws UnsupportedEncodingException if the character encoding is unsupported
[ "Generates", "a", "FullRevision", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffCalculator.java#L253-L274
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffCalculator.java
DiffCalculator.scan
private void scan(final char[] input, final int start, final int end) { this.positions = new HashMap<Character, ArrayList<Integer>>(); ArrayList<Integer> list; char c; for (int i = start; i < end; i++) { c = input[i]; list = positions.get(c); if (list == null) { list = new ArrayList<Integer>();...
java
private void scan(final char[] input, final int start, final int end) { this.positions = new HashMap<Character, ArrayList<Integer>>(); ArrayList<Integer> list; char c; for (int i = start; i < end; i++) { c = input[i]; list = positions.get(c); if (list == null) { list = new ArrayList<Integer>();...
[ "private", "void", "scan", "(", "final", "char", "[", "]", "input", ",", "final", "int", "start", ",", "final", "int", "end", ")", "{", "this", ".", "positions", "=", "new", "HashMap", "<", "Character", ",", "ArrayList", "<", "Integer", ">", ">", "("...
Scans the input and creates the character -> position mapping. @param input character array @param start start position @param end end position
[ "Scans", "the", "input", "and", "creates", "the", "character", "-", ">", "position", "mapping", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffCalculator.java#L659-L677
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffCalculator.java
DiffCalculator.findLongestMatch
private boolean findLongestMatch(final char[] revA, final ArrayList<Integer> list, final char[] revB, final int index) { int match; longestMatch_size = -1; int size = list.size(); int revAsize = revA.length; int revBsize = revB.length; int start, end, count; for (int i = 0; i < size; i++) { sta...
java
private boolean findLongestMatch(final char[] revA, final ArrayList<Integer> list, final char[] revB, final int index) { int match; longestMatch_size = -1; int size = list.size(); int revAsize = revA.length; int revBsize = revB.length; int start, end, count; for (int i = 0; i < size; i++) { sta...
[ "private", "boolean", "findLongestMatch", "(", "final", "char", "[", "]", "revA", ",", "final", "ArrayList", "<", "Integer", ">", "list", ",", "final", "char", "[", "]", "revB", ",", "final", "int", "index", ")", "{", "int", "match", ";", "longestMatch_s...
Searches the longest common substring @param revA current revision @param list list of start positions for this substring search @param revB previous revision @param index start index previous revision @return TRUE if a legal substring was found FALSE otherwise
[ "Searches", "the", "longest", "common", "substring" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/DiffCalculator.java#L693-L747
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/util/SingleKeywordTree.java
SingleKeywordTree.check
public boolean check(final char c) { current = current.get(c); if (current == null) { reset(); } return current.isKeyword(); }
java
public boolean check(final char c) { current = current.get(c); if (current == null) { reset(); } return current.isKeyword(); }
[ "public", "boolean", "check", "(", "final", "char", "c", ")", "{", "current", "=", "current", ".", "get", "(", "c", ")", ";", "if", "(", "current", "==", "null", ")", "{", "reset", "(", ")", ";", "}", "return", "current", ".", "isKeyword", "(", "...
Checks whether the character is related to the currently used node. If the comparison fails the keyword tree will be reseted to its root node, otherwise the related node will replace the current node. @param c character @return TRUE if the current node contains a keyword FALSE otherwise
[ "Checks", "whether", "the", "character", "is", "related", "to", "the", "currently", "used", "node", ".", "If", "the", "comparison", "fails", "the", "keyword", "tree", "will", "be", "reseted", "to", "its", "root", "node", "otherwise", "the", "related", "node"...
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/util/SingleKeywordTree.java#L72-L79
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/ChronoIndex.java
ChronoIndex.add
public void add(final int articleID, final int revisionCounter, final long timestamp) { if (this.articleID != articleID) { if (list != null) { addToBuffer(); } this.articleID = articleID; this.list = new ArrayList<ChronoIndexData>(); } this.list.add(new ChronoIndexData(timestamp, revisionC...
java
public void add(final int articleID, final int revisionCounter, final long timestamp) { if (this.articleID != articleID) { if (list != null) { addToBuffer(); } this.articleID = articleID; this.list = new ArrayList<ChronoIndexData>(); } this.list.add(new ChronoIndexData(timestamp, revisionC...
[ "public", "void", "add", "(", "final", "int", "articleID", ",", "final", "int", "revisionCounter", ",", "final", "long", "timestamp", ")", "{", "if", "(", "this", ".", "articleID", "!=", "articleID", ")", "{", "if", "(", "list", "!=", "null", ")", "{",...
Adds the information for an new entry in the chrono index. @param articleID ID of the article @param revisionCounter Revision counter @param timestamp Timestamp
[ "Adds", "the", "information", "for", "an", "new", "entry", "in", "the", "chrono", "index", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/ChronoIndex.java#L76-L91
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/ChronoIndex.java
ChronoIndex.addToBuffer
private void addToBuffer() { if (list != null && !list.isEmpty()) { ChronoIndexData info; // Real index in revision history mapped to RevisionCounter // Sorted by real index (time) in ascending order Collections.sort(list); StringBuilder reverseMapping = new StringBuilder(); int size = list.si...
java
private void addToBuffer() { if (list != null && !list.isEmpty()) { ChronoIndexData info; // Real index in revision history mapped to RevisionCounter // Sorted by real index (time) in ascending order Collections.sort(list); StringBuilder reverseMapping = new StringBuilder(); int size = list.si...
[ "private", "void", "addToBuffer", "(", ")", "{", "if", "(", "list", "!=", "null", "&&", "!", "list", ".", "isEmpty", "(", ")", ")", "{", "ChronoIndexData", "info", ";", "// Real index in revision history mapped to RevisionCounter", "// Sorted by real index (time) in a...
Creates the mapping and the reverse mapping. The generated information will be added to the query buffer. This list will be cleared afterwards.
[ "Creates", "the", "mapping", "and", "the", "reverse", "mapping", ".", "The", "generated", "information", "will", "be", "added", "to", "the", "query", "buffer", ".", "This", "list", "will", "be", "cleared", "afterwards", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/ChronoIndex.java#L97-L170
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.getPathToRoot
private List<Integer> getPathToRoot(int root, int node) throws WikiApiException { List<Integer> pathToRoot = new LinkedList<Integer>(); List<Integer> shortestPath = new ArrayList<Integer>(); expandPath(root, node, pathToRoot, shortestPath); if (shortestPath.size() == 0) { r...
java
private List<Integer> getPathToRoot(int root, int node) throws WikiApiException { List<Integer> pathToRoot = new LinkedList<Integer>(); List<Integer> shortestPath = new ArrayList<Integer>(); expandPath(root, node, pathToRoot, shortestPath); if (shortestPath.size() == 0) { r...
[ "private", "List", "<", "Integer", ">", "getPathToRoot", "(", "int", "root", ",", "int", "node", ")", "throws", "WikiApiException", "{", "List", "<", "Integer", ">", "pathToRoot", "=", "new", "LinkedList", "<", "Integer", ">", "(", ")", ";", "List", "<",...
Returns the shortest path from node to root as a list of pageIds of the nodes on the path. Node and root are included in the path node list. @param root The root node of the graph. @param node A node of the graph. @return The shortest path from node to root as a list of pagIs of the nodes on the path; or null if no pat...
[ "Returns", "the", "shortest", "path", "from", "node", "to", "root", "as", "a", "list", "of", "pageIds", "of", "the", "nodes", "on", "the", "path", ".", "Node", "and", "root", "are", "included", "in", "the", "path", "node", "list", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L584-L596
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.getPathLengthInEdges
public int getPathLengthInEdges(Category node1, Category node2) { if (this.graph.containsVertex(node1.getPageId()) && this.graph.containsVertex(node2.getPageId())) { if (node1.getPageId() == node2.getPageId()) { return 0; } // get the path from root node to n...
java
public int getPathLengthInEdges(Category node1, Category node2) { if (this.graph.containsVertex(node1.getPageId()) && this.graph.containsVertex(node2.getPageId())) { if (node1.getPageId() == node2.getPageId()) { return 0; } // get the path from root node to n...
[ "public", "int", "getPathLengthInEdges", "(", "Category", "node1", ",", "Category", "node2", ")", "{", "if", "(", "this", ".", "graph", ".", "containsVertex", "(", "node1", ".", "getPageId", "(", ")", ")", "&&", "this", ".", "graph", ".", "containsVertex",...
Gets the path length between two category nodes - measured in "edges". @param node1 The first category node. @param node2 The second category node. @return The number of edges of the path between node1 and node2. 0, if the nodes are identical. -1, if no path exists.
[ "Gets", "the", "path", "length", "between", "two", "category", "nodes", "-", "measured", "in", "edges", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L657-L676
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.getPathLengthInNodes
public int getPathLengthInNodes(Category node1, Category node2) throws WikiApiException { int retValue = getPathLengthInEdges(node1, node2); if (retValue == 0) { return 0; } else if (retValue > 0) { return (--retValue); } else if (retValue == -1)...
java
public int getPathLengthInNodes(Category node1, Category node2) throws WikiApiException { int retValue = getPathLengthInEdges(node1, node2); if (retValue == 0) { return 0; } else if (retValue > 0) { return (--retValue); } else if (retValue == -1)...
[ "public", "int", "getPathLengthInNodes", "(", "Category", "node1", ",", "Category", "node2", ")", "throws", "WikiApiException", "{", "int", "retValue", "=", "getPathLengthInEdges", "(", "node1", ",", "node2", ")", ";", "if", "(", "retValue", "==", "0", ")", ...
Gets the path length between two category nodes - measured in "nodes". @param node1 The first node. @param node2 The second node. @return The number of nodes of the path between node1 and node2. 0, if the nodes are identical or neighbors. -1, if no path exists.
[ "Gets", "the", "path", "length", "between", "two", "category", "nodes", "-", "measured", "in", "nodes", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L779-L795
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.createRootPathMap
public void createRootPathMap() throws WikiApiException { // do only create rootPathMap, if it was not already computed if (rootPathMap != null) { return; } File rootPathFile = new File(wiki.getWikipediaId() + "_" + this.rootPathMapFilename); // try to load rootPat...
java
public void createRootPathMap() throws WikiApiException { // do only create rootPathMap, if it was not already computed if (rootPathMap != null) { return; } File rootPathFile = new File(wiki.getWikipediaId() + "_" + this.rootPathMapFilename); // try to load rootPat...
[ "public", "void", "createRootPathMap", "(", ")", "throws", "WikiApiException", "{", "// do only create rootPathMap, if it was not already computed", "if", "(", "rootPathMap", "!=", "null", ")", "{", "return", ";", "}", "File", "rootPathFile", "=", "new", "File", "(", ...
Computes the paths from each category node to the root. Computing n paths will take some time. Thus, efficient computing is based on the assumption that all subpaths in the shortest path to the root, are also shortest paths for the corresponding nodes. Starting with the leaf nodes gives the longest initial paths with m...
[ "Computes", "the", "paths", "from", "each", "category", "node", "to", "the", "root", ".", "Computing", "n", "paths", "will", "take", "some", "time", ".", "Thus", "efficient", "computing", "is", "based", "on", "the", "assumption", "that", "all", "subpaths", ...
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L977-L1032
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.deleteRootPathMap
public void deleteRootPathMap() throws WikiApiException { File rootPathFile = new File(this.rootPathMapFilename + "_" + wiki.getLanguage() + "_" + wiki.getMetaData().getVersion()); rootPathFile.delete(); }
java
public void deleteRootPathMap() throws WikiApiException { File rootPathFile = new File(this.rootPathMapFilename + "_" + wiki.getLanguage() + "_" + wiki.getMetaData().getVersion()); rootPathFile.delete(); }
[ "public", "void", "deleteRootPathMap", "(", ")", "throws", "WikiApiException", "{", "File", "rootPathFile", "=", "new", "File", "(", "this", ".", "rootPathMapFilename", "+", "\"_\"", "+", "wiki", ".", "getLanguage", "(", ")", "+", "\"_\"", "+", "wiki", ".", ...
Deleted the root path map file. @throws WikiApiException Thrown if errors occurred.
[ "Deleted", "the", "root", "path", "map", "file", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L1039-L1042
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.getDegreeDistribution
public Map<Integer, Integer> getDegreeDistribution() { if (degreeDistribution == null) { // has not been initialized logger.debug("Calling setGraphParameters"); setGraphParameters(); } return degreeDistribution; }
java
public Map<Integer, Integer> getDegreeDistribution() { if (degreeDistribution == null) { // has not been initialized logger.debug("Calling setGraphParameters"); setGraphParameters(); } return degreeDistribution; }
[ "public", "Map", "<", "Integer", ",", "Integer", ">", "getDegreeDistribution", "(", ")", "{", "if", "(", "degreeDistribution", "==", "null", ")", "{", "// has not been initialized", "logger", ".", "debug", "(", "\"Calling setGraphParameters\"", ")", ";", "setGraph...
Computes the degree distribution. The degree of a node is the number of edges that it is connected with. The graph is treated as an undirected graph. Computing graph parameters requires touching all node pairs. Therefore, if one is called the others are computed as well and stored for later retrieval. @return A map wit...
[ "Computes", "the", "degree", "distribution", ".", "The", "degree", "of", "a", "node", "is", "the", "number", "of", "edges", "that", "it", "is", "connected", "with", ".", "The", "graph", "is", "treated", "as", "an", "undirected", "graph", ".", "Computing", ...
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L1253-L1259
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.getNumberOfNeighborConnections
private int getNumberOfNeighborConnections(int node) { int numberOfConnections = 0; // get the set of neighbors Set<Integer> neighbors = getNeighbors(node); if (neighbors.size() > 0) { // for each pair of neighbors, test if there is a connection Object[] nodeArr...
java
private int getNumberOfNeighborConnections(int node) { int numberOfConnections = 0; // get the set of neighbors Set<Integer> neighbors = getNeighbors(node); if (neighbors.size() > 0) { // for each pair of neighbors, test if there is a connection Object[] nodeArr...
[ "private", "int", "getNumberOfNeighborConnections", "(", "int", "node", ")", "{", "int", "numberOfConnections", "=", "0", ";", "// get the set of neighbors", "Set", "<", "Integer", ">", "neighbors", "=", "getNeighbors", "(", "node", ")", ";", "if", "(", "neighbo...
Get the number of connections that exist between the neighbors of a node. @param node The node under consideration. @return The number of connections that exist between the neighbors of node.
[ "Get", "the", "number", "of", "connections", "that", "exist", "between", "the", "neighbors", "of", "a", "node", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L1267-L1295
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.getNeighbors
protected Set<Integer> getNeighbors(int node) { Set<Integer> neighbors = new HashSet<Integer>(); Set<DefaultEdge> edges = undirectedGraph.edgesOf(node); for (DefaultEdge edge : edges) { if (undirectedGraph.getEdgeSource(edge) != node) { neighbors.add(undirectedGraph....
java
protected Set<Integer> getNeighbors(int node) { Set<Integer> neighbors = new HashSet<Integer>(); Set<DefaultEdge> edges = undirectedGraph.edgesOf(node); for (DefaultEdge edge : edges) { if (undirectedGraph.getEdgeSource(edge) != node) { neighbors.add(undirectedGraph....
[ "protected", "Set", "<", "Integer", ">", "getNeighbors", "(", "int", "node", ")", "{", "Set", "<", "Integer", ">", "neighbors", "=", "new", "HashSet", "<", "Integer", ">", "(", ")", ";", "Set", "<", "DefaultEdge", ">", "edges", "=", "undirectedGraph", ...
Get the neighbors of a given node. The category graph is treated as an undirected graph. @param node the reference node. @return The set of category nodes that are neighbors of this category.
[ "Get", "the", "neighbors", "of", "a", "given", "node", ".", "The", "category", "graph", "is", "treated", "as", "an", "undirected", "graph", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L1303-L1316
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.setGraphParameters
private void setGraphParameters() { // Diameter is the maximum of all shortest path lengths // Average shortest path length is (as the name says) the average of the shortest path length between all node pairs double maxPathLength = 0.0; double shortestPathLengthSum = 0.0; doubl...
java
private void setGraphParameters() { // Diameter is the maximum of all shortest path lengths // Average shortest path length is (as the name says) the average of the shortest path length between all node pairs double maxPathLength = 0.0; double shortestPathLengthSum = 0.0; doubl...
[ "private", "void", "setGraphParameters", "(", ")", "{", "// Diameter is the maximum of all shortest path lengths", "// Average shortest path length is (as the name says) the average of the shortest path length between all node pairs", "double", "maxPathLength", "=", "0.0", ";", "double", ...
Computes and sets the diameter, the average degree and the average shortest path length of the graph. Do not call this in the constructor. May run a while. It is called in the getters, if parameters are not yet initialized when retrieved.
[ "Computes", "and", "sets", "the", "diameter", "the", "average", "degree", "and", "the", "average", "shortest", "path", "length", "of", "the", "graph", ".", "Do", "not", "call", "this", "in", "the", "constructor", ".", "May", "run", "a", "while", ".", "It...
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L1333-L1388
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.computeDepth
private double computeDepth() throws WikiApiException { Category root = wiki.getMetaData().getMainCategory(); if (root == null) { logger.error("There is no root node for this wiki. Check the parameter that provides the name of the root node."); return 0.0; } // te...
java
private double computeDepth() throws WikiApiException { Category root = wiki.getMetaData().getMainCategory(); if (root == null) { logger.error("There is no root node for this wiki. Check the parameter that provides the name of the root node."); return 0.0; } // te...
[ "private", "double", "computeDepth", "(", ")", "throws", "WikiApiException", "{", "Category", "root", "=", "wiki", ".", "getMetaData", "(", ")", ".", "getMainCategory", "(", ")", ";", "if", "(", "root", "==", "null", ")", "{", "logger", ".", "error", "("...
Computes the depth of the category graph, i.e. the maximum path length starting with the root node. @return The depth of the hierarchy. @throws WikiApiException Thrown if errors occurred.
[ "Computes", "the", "depth", "of", "the", "category", "graph", "i", ".", "e", ".", "the", "maximum", "path", "length", "starting", "with", "the", "root", "node", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L1579-L1594
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.serializeMap
private void serializeMap(Map<?,?> map, File file) { try(ObjectOutputStream os = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)))){ os.writeObject(map); } catch (Exception e) { logger.error(e.getLocalizedMessage(), e); } }
java
private void serializeMap(Map<?,?> map, File file) { try(ObjectOutputStream os = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)))){ os.writeObject(map); } catch (Exception e) { logger.error(e.getLocalizedMessage(), e); } }
[ "private", "void", "serializeMap", "(", "Map", "<", "?", ",", "?", ">", "map", ",", "File", "file", ")", "{", "try", "(", "ObjectOutputStream", "os", "=", "new", "ObjectOutputStream", "(", "new", "BufferedOutputStream", "(", "new", "FileOutputStream", "(", ...
Serialize a Map. @param map The map to serialize. @param file The file for saving the map.
[ "Serialize", "a", "Map", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L1644-L1650
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.deserializeMap
private Map deserializeMap(File file) { Map<?,?> map; try(ObjectInputStream is = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)))) { map = (Map<?,?>) is.readObject(); } catch (Exception e) { logger.error(e.getLocalizedMessage(), e); re...
java
private Map deserializeMap(File file) { Map<?,?> map; try(ObjectInputStream is = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)))) { map = (Map<?,?>) is.readObject(); } catch (Exception e) { logger.error(e.getLocalizedMessage(), e); re...
[ "private", "Map", "deserializeMap", "(", "File", "file", ")", "{", "Map", "<", "?", ",", "?", ">", "map", ";", "try", "(", "ObjectInputStream", "is", "=", "new", "ObjectInputStream", "(", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "f...
Deserialize a map @param file The file with the map.
[ "Deserialize", "a", "map" ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L1656-L1665
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java
CategoryGraph.saveGraph
public void saveGraph(String destination) throws WikiApiException { try { GraphSerialization.saveGraph(graph, destination); } catch (IOException e) { throw new WikiApiException(e); } }
java
public void saveGraph(String destination) throws WikiApiException { try { GraphSerialization.saveGraph(graph, destination); } catch (IOException e) { throw new WikiApiException(e); } }
[ "public", "void", "saveGraph", "(", "String", "destination", ")", "throws", "WikiApiException", "{", "try", "{", "GraphSerialization", ".", "saveGraph", "(", "graph", ",", "destination", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "ne...
Serializes the graph to the given destination. @param destination The destination to which should be saved. @throws WikiApiException Thrown if errors occurred.
[ "Serializes", "the", "graph", "to", "the", "given", "destination", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L1673-L1679
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/ParsedPage.java
ParsedPage.setSections
public void setSections( List<Section> sections ){ for( Section s: sections ) superSection.addSection(s); }
java
public void setSections( List<Section> sections ){ for( Section s: sections ) superSection.addSection(s); }
[ "public", "void", "setSections", "(", "List", "<", "Section", ">", "sections", ")", "{", "for", "(", "Section", "s", ":", "sections", ")", "superSection", ".", "addSection", "(", "s", ")", ";", "}" ]
Sets the Sections of a ParsedPage. @param sections A list of sections.
[ "Sets", "the", "Sections", "of", "a", "ParsedPage", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/ParsedPage.java#L180-L182
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/panels/OutputPanel.java
OutputPanel.validate
@Override public void validate() { boolean flagA = !controller.isEnableSQLDatabaseOutput(); boolean flagB = controller.isMultipleOutputFiles(); OutputCompressionEnum oce = controller.getOutputCompression(); enableZipEncodingCompression.setSelected(controller .isZipCompressionEnabled()); disableOutpu...
java
@Override public void validate() { boolean flagA = !controller.isEnableSQLDatabaseOutput(); boolean flagB = controller.isMultipleOutputFiles(); OutputCompressionEnum oce = controller.getOutputCompression(); enableZipEncodingCompression.setSelected(controller .isZipCompressionEnabled()); disableOutpu...
[ "@", "Override", "public", "void", "validate", "(", ")", "{", "boolean", "flagA", "=", "!", "controller", ".", "isEnableSQLDatabaseOutput", "(", ")", ";", "boolean", "flagB", "=", "controller", ".", "isMultipleOutputFiles", "(", ")", ";", "OutputCompressionEnum"...
A call of this method should validate the status of the panels components.
[ "A", "call", "of", "this", "method", "should", "validate", "the", "status", "of", "the", "panels", "components", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/panels/OutputPanel.java#L247-L290
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java
BlockManagement.copy
private String copy(final char[] array, final int start, final int end) { StringBuilder text = new StringBuilder(); for (int j = start; j < end; j++) { text.append(array[j]); } return text.toString(); }
java
private String copy(final char[] array, final int start, final int end) { StringBuilder text = new StringBuilder(); for (int j = start; j < end; j++) { text.append(array[j]); } return text.toString(); }
[ "private", "String", "copy", "(", "final", "char", "[", "]", "array", ",", "final", "int", "start", ",", "final", "int", "end", ")", "{", "StringBuilder", "text", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "j", "=", "start", ";", ...
Copies the specified interval of characters for the array. @return specified interval
[ "Copies", "the", "specified", "interval", "of", "characters", "for", "the", "array", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java#L190-L198
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java
BlockManagement.insert
private void insert(final char[] revB, final DiffBlock curB) throws UnsupportedEncodingException { String text = copy(revB, curB.getRevBStart(), curB.getRevBEnd()); // Insert (C S L T) DiffPart action = new DiffPart(DiffAction.INSERT); // S action.setStart(version.length()); codecData.checkBlocksizeS(...
java
private void insert(final char[] revB, final DiffBlock curB) throws UnsupportedEncodingException { String text = copy(revB, curB.getRevBStart(), curB.getRevBEnd()); // Insert (C S L T) DiffPart action = new DiffPart(DiffAction.INSERT); // S action.setStart(version.length()); codecData.checkBlocksizeS(...
[ "private", "void", "insert", "(", "final", "char", "[", "]", "revB", ",", "final", "DiffBlock", "curB", ")", "throws", "UnsupportedEncodingException", "{", "String", "text", "=", "copy", "(", "revB", ",", "curB", ".", "getRevBStart", "(", ")", ",", "curB",...
Creates an insert operation. @param revB revision B @param curB Reference to the block B @throws UnsupportedEncodingException if the character encoding is unsupported
[ "Creates", "an", "insert", "operation", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java#L211-L231
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java
BlockManagement.delete
private void delete(final DiffBlock curA) { // Delete (C S E) DiffPart action = new DiffPart(DiffAction.DELETE); // S action.setStart(version.length()); codecData.checkBlocksizeS(version.length()); // E action.setLength(curA.getRevAEnd() - curA.getRevAStart()); codecData.checkBlocksizeE(action.getLe...
java
private void delete(final DiffBlock curA) { // Delete (C S E) DiffPart action = new DiffPart(DiffAction.DELETE); // S action.setStart(version.length()); codecData.checkBlocksizeS(version.length()); // E action.setLength(curA.getRevAEnd() - curA.getRevAStart()); codecData.checkBlocksizeE(action.getLe...
[ "private", "void", "delete", "(", "final", "DiffBlock", "curA", ")", "{", "// Delete (C S E)", "DiffPart", "action", "=", "new", "DiffPart", "(", "DiffAction", ".", "DELETE", ")", ";", "// S", "action", ".", "setStart", "(", "version", ".", "length", "(", ...
Creates a delete operation. @param curA Reference to the block A @throws UnsupportedEncodingException if the character encoding is unsupported
[ "Creates", "a", "delete", "operation", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java#L242-L257
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java
BlockManagement.replace
private void replace(final char[] revA, final char[] revB, final DiffBlock curA, final DiffBlock curB) throws UnsupportedEncodingException { // Replace (C S E L T) String text = copy(revB, curB.getRevBStart(), curB.getRevBEnd()); DiffPart action = new DiffPart(DiffAction.REPLACE); // S action.setStar...
java
private void replace(final char[] revA, final char[] revB, final DiffBlock curA, final DiffBlock curB) throws UnsupportedEncodingException { // Replace (C S E L T) String text = copy(revB, curB.getRevBStart(), curB.getRevBEnd()); DiffPart action = new DiffPart(DiffAction.REPLACE); // S action.setStar...
[ "private", "void", "replace", "(", "final", "char", "[", "]", "revA", ",", "final", "char", "[", "]", "revB", ",", "final", "DiffBlock", "curA", ",", "final", "DiffBlock", "curB", ")", "throws", "UnsupportedEncodingException", "{", "// Replace (C S E L T)", "S...
Creates a replace operation. @param revA Reference to revision A @param revB Reference to revision B @param curA Reference to current block A @param curB Reference to current block B @throws UnsupportedEncodingException if the character encoding is unsupported
[ "Creates", "a", "replace", "operation", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java#L274-L299
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java
BlockManagement.cut
private void cut(final char[] revA, final DiffBlock curA) { String text = copy(revA, curA.getRevAStart(), curA.getRevAEnd()); // Cut (C S E B) DiffPart action = new DiffPart(DiffAction.CUT); // S action.setStart(version.length()); codecData.checkBlocksizeS(version.length()); // E action.setLength(c...
java
private void cut(final char[] revA, final DiffBlock curA) { String text = copy(revA, curA.getRevAStart(), curA.getRevAEnd()); // Cut (C S E B) DiffPart action = new DiffPart(DiffAction.CUT); // S action.setStart(version.length()); codecData.checkBlocksizeS(version.length()); // E action.setLength(c...
[ "private", "void", "cut", "(", "final", "char", "[", "]", "revA", ",", "final", "DiffBlock", "curA", ")", "{", "String", "text", "=", "copy", "(", "revA", ",", "curA", ".", "getRevAStart", "(", ")", ",", "curA", ".", "getRevAEnd", "(", ")", ")", ";...
Creates a cut operation. @param revA Reference to revision A @param curA Reference to current block A
[ "Creates", "a", "cut", "operation", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java#L309-L332
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java
BlockManagement.paste
private void paste(final DiffBlock curB) { String text = bufferMap.remove(curB.getId()); // Paste (C S B) DiffPart action = new DiffPart(DiffAction.PASTE); // S action.setStart(version.length()); codecData.checkBlocksizeS(version.length()); // B action.setText(Integer.toString(curB.getId())); cod...
java
private void paste(final DiffBlock curB) { String text = bufferMap.remove(curB.getId()); // Paste (C S B) DiffPart action = new DiffPart(DiffAction.PASTE); // S action.setStart(version.length()); codecData.checkBlocksizeS(version.length()); // B action.setText(Integer.toString(curB.getId())); cod...
[ "private", "void", "paste", "(", "final", "DiffBlock", "curB", ")", "{", "String", "text", "=", "bufferMap", ".", "remove", "(", "curB", ".", "getId", "(", ")", ")", ";", "// Paste (C S B)", "DiffPart", "action", "=", "new", "DiffPart", "(", "DiffAction", ...
Creates a paste operation. @param curB Reference to current block B
[ "Creates", "a", "paste", "operation", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/diff/calculation/BlockManagement.java#L340-L359
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java
Logger.log
private synchronized void log(final String text) { try { this.writer.write(text); } catch (IOException ioe) { ioe.printStackTrace(); } }
java
private synchronized void log(final String text) { try { this.writer.write(text); } catch (IOException ioe) { ioe.printStackTrace(); } }
[ "private", "synchronized", "void", "log", "(", "final", "String", "text", ")", "{", "try", "{", "this", ".", "writer", ".", "write", "(", "text", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "ioe", ".", "printStackTrace", "(", ")", ";...
Writes the given text to the output file. @param text log message
[ "Writes", "the", "given", "text", "to", "the", "output", "file", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java#L138-L147
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java
Logger.logError
public void logError(final Level level, final String message, final Error e) { try { Logger errors = LoggingFactory .getLogger(LoggingFactory.NAME_ERROR_LOGGER); errors.logThrowable(level, message, e); } catch (LoggingException ex) { ex.printStackTrace(); } if (logLevel.toInt() > level.toInt...
java
public void logError(final Level level, final String message, final Error e) { try { Logger errors = LoggingFactory .getLogger(LoggingFactory.NAME_ERROR_LOGGER); errors.logThrowable(level, message, e); } catch (LoggingException ex) { ex.printStackTrace(); } if (logLevel.toInt() > level.toInt...
[ "public", "void", "logError", "(", "final", "Level", "level", ",", "final", "String", "message", ",", "final", "Error", "e", ")", "{", "try", "{", "Logger", "errors", "=", "LoggingFactory", ".", "getLogger", "(", "LoggingFactory", ".", "NAME_ERROR_LOGGER", "...
The occurred error with the related log level and message has to be given to this method. This method will verify if the message should be logged or not. @param level log level @param message message @param e Error
[ "The", "occurred", "error", "with", "the", "related", "log", "level", "and", "message", "has", "to", "be", "given", "to", "this", "method", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java#L162-L180
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java
Logger.logMessage
public synchronized void logMessage(final Level level, final String message) { if (logLevel.toInt() > level.toInt()) { return; } try { this.writer.write(System.currentTimeMillis() + "\t" + consumerName + " [" + type.toString() + "] " + "\t" + message + "\r\n"); this.writer.flush(); } catch (I...
java
public synchronized void logMessage(final Level level, final String message) { if (logLevel.toInt() > level.toInt()) { return; } try { this.writer.write(System.currentTimeMillis() + "\t" + consumerName + " [" + type.toString() + "] " + "\t" + message + "\r\n"); this.writer.flush(); } catch (I...
[ "public", "synchronized", "void", "logMessage", "(", "final", "Level", "level", ",", "final", "String", "message", ")", "{", "if", "(", "logLevel", ".", "toInt", "(", ")", ">", "level", ".", "toInt", "(", ")", ")", "{", "return", ";", "}", "try", "{"...
This method will be called with a message and the related log level. It be verified if the message should be logged or not. The format of the logged message is: \t consumerName [ Type of Logger ] \t message \r\n @param level level @param message message
[ "This", "method", "will", "be", "called", "with", "a", "message", "and", "the", "related", "log", "level", ".", "It", "be", "verified", "if", "the", "message", "should", "be", "logged", "or", "not", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java#L229-L244
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java
Logger.logThrowable
private synchronized void logThrowable(final Level level, final String message, final Throwable t) { if (t != null) { log("\r\n[" + System.currentTimeMillis() + "]\t" + message); log("\r\n" + t); log("\r\n"); for (StackTraceElement st : t.getStackTrace()) { log("\t" + st.toString() + "\r\n"); ...
java
private synchronized void logThrowable(final Level level, final String message, final Throwable t) { if (t != null) { log("\r\n[" + System.currentTimeMillis() + "]\t" + message); log("\r\n" + t); log("\r\n"); for (StackTraceElement st : t.getStackTrace()) { log("\t" + st.toString() + "\r\n"); ...
[ "private", "synchronized", "void", "logThrowable", "(", "final", "Level", "level", ",", "final", "String", "message", ",", "final", "Throwable", "t", ")", "{", "if", "(", "t", "!=", "null", ")", "{", "log", "(", "\"\\r\\n[\"", "+", "System", ".", "curren...
The occurred error or exception with the related log level and message will be logged by this method. @param level log level @param message message @param t Throwable
[ "The", "occurred", "error", "or", "exception", "with", "the", "related", "log", "level", "and", "message", "will", "be", "logged", "by", "this", "method", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/Logger.java#L257-L283
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/StringUtils.java
StringUtils.sqlEscape
public static String sqlEscape(String str) { final int len = str.length(); buffer.setLength(0); StringBuilder sql = buffer; for (int i = 0; i < len; i++) { char c = str.charAt(i); switch (c) { case '\u0000': sql.append('\\').append('0'); break; case '\n': sql.append('\\').append('n'); ...
java
public static String sqlEscape(String str) { final int len = str.length(); buffer.setLength(0); StringBuilder sql = buffer; for (int i = 0; i < len; i++) { char c = str.charAt(i); switch (c) { case '\u0000': sql.append('\\').append('0'); break; case '\n': sql.append('\\').append('n'); ...
[ "public", "static", "String", "sqlEscape", "(", "String", "str", ")", "{", "final", "int", "len", "=", "str", ".", "length", "(", ")", ";", "buffer", ".", "setLength", "(", "0", ")", ";", "StringBuilder", "sql", "=", "buffer", ";", "for", "(", "int",...
Replaces all problematic characters from a String with their escaped versions to make it SQL conform. @param str unescaped String @return SQL safe escaped String
[ "Replaces", "all", "problematic", "characters", "from", "a", "String", "with", "their", "escaped", "versions", "to", "make", "it", "SQL", "conform", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/StringUtils.java#L97-L144
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/parser/ParseUtils.java
ParseUtils.getTemplateNames
public static List<String> getTemplateNames(String text, String title) throws LinkTargetException, EngineException, FileNotFoundException, JAXBException{ return (List<String>) parsePage(new TemplateNameExtractor(), text, title, -1); }
java
public static List<String> getTemplateNames(String text, String title) throws LinkTargetException, EngineException, FileNotFoundException, JAXBException{ return (List<String>) parsePage(new TemplateNameExtractor(), text, title, -1); }
[ "public", "static", "List", "<", "String", ">", "getTemplateNames", "(", "String", "text", ",", "String", "title", ")", "throws", "LinkTargetException", ",", "EngineException", ",", "FileNotFoundException", ",", "JAXBException", "{", "return", "(", "List", "<", ...
Extracts template names from Wikitext by descending into every node and looking for templates. Results may contain duplicates if template appears multiple times in the article. @param text article text with wiki markup @param title article title @return list of template names @throws EngineException if the wiki page c...
[ "Extracts", "template", "names", "from", "Wikitext", "by", "descending", "into", "every", "node", "and", "looking", "for", "templates", ".", "Results", "may", "contain", "duplicates", "if", "template", "appears", "multiple", "times", "in", "the", "article", "." ...
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/parser/ParseUtils.java#L79-L81
train
dkpro/dkpro-jwpl
de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/parser/ParseUtils.java
ParseUtils.parsePage
private static Object parsePage(AstVisitor v, String text, String title, long revision) throws LinkTargetException, EngineException, FileNotFoundException, JAXBException{ // Use the provided visitor to parse the page return v.go(getCompiledPage(text, title, revision).getPage()); }
java
private static Object parsePage(AstVisitor v, String text, String title, long revision) throws LinkTargetException, EngineException, FileNotFoundException, JAXBException{ // Use the provided visitor to parse the page return v.go(getCompiledPage(text, title, revision).getPage()); }
[ "private", "static", "Object", "parsePage", "(", "AstVisitor", "v", ",", "String", "text", ",", "String", "title", ",", "long", "revision", ")", "throws", "LinkTargetException", ",", "EngineException", ",", "FileNotFoundException", ",", "JAXBException", "{", "// U...
Parses the page with the Sweble parser using a SimpleWikiConfiguration and the provided visitor. @return the parsed page. The actual return type depends on the provided visitor. You have to cast the return type according to the return type of the go() method of your visitor. @throws EngineException if the wiki page co...
[ "Parses", "the", "page", "with", "the", "Sweble", "parser", "using", "a", "SimpleWikiConfiguration", "and", "the", "provided", "visitor", "." ]
0a0304b6a0aa13acc18838957994e06dd4613a58
https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/parser/ParseUtils.java#L92-L95
train