id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
105,700 | 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 |
105,701 | 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 |
105,702 | 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 |
105,703 | 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 |
105,704 | 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 |
105,705 | 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 |
105,706 | 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 |
105,707 | 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 |
105,708 | 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 |
105,709 | 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 |
105,710 | 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 |
105,711 | 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 |
105,712 | 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 |
105,713 | 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 |
105,714 | 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 |
105,715 | 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 |
105,716 | 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 |
105,717 | 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 |
105,718 | 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 |
105,719 | 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 |
105,720 | 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 |
105,721 | 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 |
105,722 | 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 |
105,723 | 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 |
105,724 | 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 |
105,725 | 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 |
105,726 | 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 |
105,727 | 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 |
105,728 | 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 |
105,729 | 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 |
105,730 | 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 |
105,731 | 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 |
105,732 | 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 |
105,733 | 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 |
105,734 | 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 |
105,735 | 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 |
105,736 | 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 |
105,737 | 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 |
105,738 | 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 |
105,739 | 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 |
105,740 | 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 |
105,741 | 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 |
105,742 | 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 |
105,743 | 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 |
105,744 | 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 |
105,745 | 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 |
105,746 | 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 |
105,747 | 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 |
105,748 | 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 |
105,749 | 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 |
105,750 | 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 |
105,751 | 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 |
105,752 | 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 |
105,753 | 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 |
105,754 | 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 |
105,755 | 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 |
105,756 | 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 |
105,757 | 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 |
105,758 | 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 |
105,759 | 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 |
105,760 | 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 |
105,761 | 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 |
105,762 | 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 |
105,763 | 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 |
105,764 | 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 |
105,765 | 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 |
105,766 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/parser/ParseUtils.java | ParseUtils.getTemplateMarker | private static String getTemplateMarker(String str) throws IllegalStateException{
Pattern p = Pattern.compile("\\{\\{(.*?)\\}\\}", Pattern.DOTALL);
Matcher matcher = p.matcher(str);
String tpl = null;
while(matcher.find())
{
if(tpl!=null){
throw new IllegalStateException("More than one template i... | java | private static String getTemplateMarker(String str) throws IllegalStateException{
Pattern p = Pattern.compile("\\{\\{(.*?)\\}\\}", Pattern.DOTALL);
Matcher matcher = p.matcher(str);
String tpl = null;
while(matcher.find())
{
if(tpl!=null){
throw new IllegalStateException("More than one template i... | [
"private",
"static",
"String",
"getTemplateMarker",
"(",
"String",
"str",
")",
"throws",
"IllegalStateException",
"{",
"Pattern",
"p",
"=",
"Pattern",
".",
"compile",
"(",
"\"\\\\{\\\\{(.*?)\\\\}\\\\}\"",
",",
"Pattern",
".",
"DOTALL",
")",
";",
"Matcher",
"matche... | Returns the template marker of the sentence.
Assumes hat a sentence has only ONE marker.
If the sentence contains more than one template, an IllegalStateException
is thrown.
If the String does not contain a marker, null is returned
@param str A string with template markers
@return the template marker | [
"Returns",
"the",
"template",
"marker",
"of",
"the",
"sentence",
"."
] | 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#L143-L156 |
105,767 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/consumer/dump/writer/TimedSQLFileWriter.java | TimedSQLFileWriter.process | @Override
public void process(final Task<Diff> task)
throws ConfigurationException, IOException, SQLConsumerException
{
long startTime = System.currentTimeMillis();
TaskTypes type = task.getTaskType();
if (type == TaskTypes.TASK_FULL || type == TaskTypes.TASK_PARTIAL_FIRST) {
this.sqlEncoder.init();
... | java | @Override
public void process(final Task<Diff> task)
throws ConfigurationException, IOException, SQLConsumerException
{
long startTime = System.currentTimeMillis();
TaskTypes type = task.getTaskType();
if (type == TaskTypes.TASK_FULL || type == TaskTypes.TASK_PARTIAL_FIRST) {
this.sqlEncoder.init();
... | [
"@",
"Override",
"public",
"void",
"process",
"(",
"final",
"Task",
"<",
"Diff",
">",
"task",
")",
"throws",
"ConfigurationException",
",",
"IOException",
",",
"SQLConsumerException",
"{",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
... | This method will process the given DiffTask and send him to the specified
output.
@param task
DiffTask
@throws ConfigurationException
if problems occurred while initializing the components
@throws IOException
if problems occurred while writing the output (to file or
archive)
@throws SQLConsumerException
if problems... | [
"This",
"method",
"will",
"process",
"the",
"given",
"DiffTask",
"and",
"send",
"him",
"to",
"the",
"specified",
"output",
"."
] | 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/TimedSQLFileWriter.java#L114-L145 |
105,768 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/tasks/Task.java | Task.add | public void add(final D data)
{
this.container.add(data);
// if the size of data is known add the value to the task size
if (data instanceof ISizeable) {
this.byteSize += ((ISizeable) data).byteSize();
}
} | java | public void add(final D data)
{
this.container.add(data);
// if the size of data is known add the value to the task size
if (data instanceof ISizeable) {
this.byteSize += ((ISizeable) data).byteSize();
}
} | [
"public",
"void",
"add",
"(",
"final",
"D",
"data",
")",
"{",
"this",
".",
"container",
".",
"add",
"(",
"data",
")",
";",
"// if the size of data is known add the value to the task size",
"if",
"(",
"data",
"instanceof",
"ISizeable",
")",
"{",
"this",
".",
"b... | Adds data to this task.
@param data
Reference to the data object. | [
"Adds",
"data",
"to",
"this",
"task",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/tasks/Task.java#L155-L163 |
105,769 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/IndexGenerator.java | IndexGenerator.generate | public void generate()
throws WikiApiException
{
Indexer data = null;
try {
data = new Indexer(config);
System.out.println("GENERATING INDEX STARTED");
long bufferSize = config.getBufferSize();
Revision rev;
long count = 0;
long last = 0, now, start = System.currentTimeMillis();
Iterator<... | java | public void generate()
throws WikiApiException
{
Indexer data = null;
try {
data = new Indexer(config);
System.out.println("GENERATING INDEX STARTED");
long bufferSize = config.getBufferSize();
Revision rev;
long count = 0;
long last = 0, now, start = System.currentTimeMillis();
Iterator<... | [
"public",
"void",
"generate",
"(",
")",
"throws",
"WikiApiException",
"{",
"Indexer",
"data",
"=",
"null",
";",
"try",
"{",
"data",
"=",
"new",
"Indexer",
"(",
"config",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"GENERATING INDEX STARTED\"",
"... | Starts the generation of the indices.
@throws WikiApiException
if an error occurs | [
"Starts",
"the",
"generation",
"of",
"the",
"indices",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/IndexGenerator.java#L62-L104 |
105,770 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/IndexGenerator.java | IndexGenerator.load | private static Properties load(String configFilePath)
{
Properties props = new Properties();
BufferedInputStream fis = null;
try {
File configFile = new File(configFilePath);
fis = new BufferedInputStream(new FileInputStream(configFile));
props.load(fis);
}
catch(IOException ... | java | private static Properties load(String configFilePath)
{
Properties props = new Properties();
BufferedInputStream fis = null;
try {
File configFile = new File(configFilePath);
fis = new BufferedInputStream(new FileInputStream(configFile));
props.load(fis);
}
catch(IOException ... | [
"private",
"static",
"Properties",
"load",
"(",
"String",
"configFilePath",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"BufferedInputStream",
"fis",
"=",
"null",
";",
"try",
"{",
"File",
"configFile",
"=",
"new",
"File",
"(",
... | Load a properties file from the classpath
@param propsName
path to the configuration file
@return Properties the properties object containing the configuration
data
@throws IOException
if an error occurs while accessing the configuration file | [
"Load",
"a",
"properties",
"file",
"from",
"the",
"classpath"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/IndexGenerator.java#L213-L236 |
105,771 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/RevisionPair.java | RevisionPair.getInlineTextPairs | public List<TextPair> getInlineTextPairs(boolean markTemplates) {
List<TextPair> pairList = new ArrayList<TextPair>();
try {
//extract sections
List<ExtractedSection> beforeSections=null;
List<ExtractedSection> afterSections=null;
if(markTemplates){
//add inline marker for the template
... | java | public List<TextPair> getInlineTextPairs(boolean markTemplates) {
List<TextPair> pairList = new ArrayList<TextPair>();
try {
//extract sections
List<ExtractedSection> beforeSections=null;
List<ExtractedSection> afterSections=null;
if(markTemplates){
//add inline marker for the template
... | [
"public",
"List",
"<",
"TextPair",
">",
"getInlineTextPairs",
"(",
"boolean",
"markTemplates",
")",
"{",
"List",
"<",
"TextPair",
">",
"pairList",
"=",
"new",
"ArrayList",
"<",
"TextPair",
">",
"(",
")",
";",
"try",
"{",
"//extract sections\r",
"List",
"<",
... | Returns the text "around the given template" and returns the corresponding
text in the other pair part of the RevisionPair.
Currently, this is done section-based. On TextPairPart contains a section
with a template and the other contains the corresponding section
after the template has been deleted (in deleteTemplate m... | [
"Returns",
"the",
"text",
"around",
"the",
"given",
"template",
"and",
"returns",
"the",
"corresponding",
"text",
"in",
"the",
"other",
"pair",
"part",
"of",
"the",
"RevisionPair",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/RevisionPair.java#L99-L145 |
105,772 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/RevisionPair.java | RevisionPair.containsIgnoreCase | private boolean containsIgnoreCase(List<String> stringlist, String match) {
for (String s : stringlist) {
if (s.equalsIgnoreCase(match)) {
return true;
}
}
return false;
} | java | private boolean containsIgnoreCase(List<String> stringlist, String match) {
for (String s : stringlist) {
if (s.equalsIgnoreCase(match)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"containsIgnoreCase",
"(",
"List",
"<",
"String",
">",
"stringlist",
",",
"String",
"match",
")",
"{",
"for",
"(",
"String",
"s",
":",
"stringlist",
")",
"{",
"if",
"(",
"s",
".",
"equalsIgnoreCase",
"(",
"match",
")",
")",
"{",
"... | Checks if a list of string contains a String while ignoring case
@param stringlist a list of string
@param match the string to look for
@return true, if the list contains the string, false else | [
"Checks",
"if",
"a",
"list",
"of",
"string",
"contains",
"a",
"String",
"while",
"ignoring",
"case"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/RevisionPair.java#L154-L161 |
105,773 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.listToLowerCase | private List<String> listToLowerCase(List<String> l)
{
List<String> result = new ArrayList<String>();
for (String s : l)
{
result.add(s.toLowerCase());
}
return result;
} | java | private List<String> listToLowerCase(List<String> l)
{
List<String> result = new ArrayList<String>();
for (String s : l)
{
result.add(s.toLowerCase());
}
return result;
} | [
"private",
"List",
"<",
"String",
">",
"listToLowerCase",
"(",
"List",
"<",
"String",
">",
"l",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"String",
"s",
":",
"l",
")",
... | Converts a List of Strings to lower case Strings. | [
"Converts",
"a",
"List",
"of",
"Strings",
"to",
"lower",
"case",
"Strings",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L247-L255 |
105,774 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.configurationInfo | @Override
public String configurationInfo()
{
StringBuilder result = new StringBuilder();
result.append("MediaWikiParser configuration:\n");
result.append("ParserClass: " + this.getClass() + "\n");
result.append("ShowImageText: " + showImageText + "\n");
result.append("DeleteTags: " + deleteTags + "\n");
... | java | @Override
public String configurationInfo()
{
StringBuilder result = new StringBuilder();
result.append("MediaWikiParser configuration:\n");
result.append("ParserClass: " + this.getClass() + "\n");
result.append("ShowImageText: " + showImageText + "\n");
result.append("DeleteTags: " + deleteTags + "\n");
... | [
"@",
"Override",
"public",
"String",
"configurationInfo",
"(",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"result",
".",
"append",
"(",
"\"MediaWikiParser configuration:\\n\"",
")",
";",
"result",
".",
"append",
"(",
"\"Pars... | Look at the MediaWikiParser interface for a description... | [
"Look",
"at",
"the",
"MediaWikiParser",
"interface",
"for",
"a",
"description",
"..."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L260-L297 |
105,775 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.runConfig | private boolean runConfig()
{
if (lineSeparator == null)
{
logger.debug("Set lineSeparator");
return false;
}
if (categoryIdentifers == null)
{
logger.warn("Set categoryIdentifers");
return false;
}
if (languageIdentifers == null)
{
logger.warn("Set languageIdentifers");
return false;... | java | private boolean runConfig()
{
if (lineSeparator == null)
{
logger.debug("Set lineSeparator");
return false;
}
if (categoryIdentifers == null)
{
logger.warn("Set categoryIdentifers");
return false;
}
if (languageIdentifers == null)
{
logger.warn("Set languageIdentifers");
return false;... | [
"private",
"boolean",
"runConfig",
"(",
")",
"{",
"if",
"(",
"lineSeparator",
"==",
"null",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Set lineSeparator\"",
")",
";",
"return",
"false",
";",
"}",
"if",
"(",
"categoryIdentifers",
"==",
"null",
")",
"{",
"l... | Checks if the configuration is runnable. | [
"Checks",
"if",
"the",
"configuration",
"is",
"runnable",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L302-L330 |
105,776 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.deleteTOCTag | private void deleteTOCTag(SpanManager sm)
{
// delete all __TOC__ from SRC
int temp = 0;
while ((temp = sm.indexOf("__TOC__", temp)) != -1)
{
sm.delete(temp, temp + 2 + 3 + 2);
}
// delete all __NOTOC__ from SRC
temp = 0;
while ((temp = sm.indexOf("__NOTOC__", temp)) != -1)
{
sm.delete(temp, t... | java | private void deleteTOCTag(SpanManager sm)
{
// delete all __TOC__ from SRC
int temp = 0;
while ((temp = sm.indexOf("__TOC__", temp)) != -1)
{
sm.delete(temp, temp + 2 + 3 + 2);
}
// delete all __NOTOC__ from SRC
temp = 0;
while ((temp = sm.indexOf("__NOTOC__", temp)) != -1)
{
sm.delete(temp, t... | [
"private",
"void",
"deleteTOCTag",
"(",
"SpanManager",
"sm",
")",
"{",
"// delete all __TOC__ from SRC",
"int",
"temp",
"=",
"0",
";",
"while",
"(",
"(",
"temp",
"=",
"sm",
".",
"indexOf",
"(",
"\"__TOC__\"",
",",
"temp",
")",
")",
"!=",
"-",
"1",
")",
... | Deleteing ALL TOC Tags | [
"Deleteing",
"ALL",
"TOC",
"Tags"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L475-L490 |
105,777 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.getLineType | private lineType getLineType(SpanManager sm, Span lineSpan)
{
switch (lineSpan.charAt(0, sm))
{
case '{':
if (lineSpan.charAt(1, sm) == '|')
{
return lineType.TABLE;
}
else
{
return lineType.PARAGRAPH;
}
case '=':
if (lineSpan.length() > 2
&& sm.charAt(lineSpan.getEnd() - 1... | java | private lineType getLineType(SpanManager sm, Span lineSpan)
{
switch (lineSpan.charAt(0, sm))
{
case '{':
if (lineSpan.charAt(1, sm) == '|')
{
return lineType.TABLE;
}
else
{
return lineType.PARAGRAPH;
}
case '=':
if (lineSpan.length() > 2
&& sm.charAt(lineSpan.getEnd() - 1... | [
"private",
"lineType",
"getLineType",
"(",
"SpanManager",
"sm",
",",
"Span",
"lineSpan",
")",
"{",
"switch",
"(",
"lineSpan",
".",
"charAt",
"(",
"0",
",",
"sm",
")",
")",
"{",
"case",
"'",
"'",
":",
"if",
"(",
"lineSpan",
".",
"charAt",
"(",
"1",
... | Retunrns the Type of a line, this is mainly done by the First Char of the
Line... | [
"Retunrns",
"the",
"Type",
"of",
"a",
"line",
"this",
"is",
"mainly",
"done",
"by",
"the",
"First",
"Char",
"of",
"the",
"Line",
"..."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L662-L748 |
105,778 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.getSectionLevel | private int getSectionLevel(SpanManager sm, Span sectionNameSpan)
{
int begin = sectionNameSpan.getStart();
int end = sectionNameSpan.getEnd();
int level = 0;
try
{
while ((sm.charAt(begin + level) == '=')
&& (sm.charAt(end - 1 - level) == '='))
{
level++;
}
}
catch (StringIndexOutOfBo... | java | private int getSectionLevel(SpanManager sm, Span sectionNameSpan)
{
int begin = sectionNameSpan.getStart();
int end = sectionNameSpan.getEnd();
int level = 0;
try
{
while ((sm.charAt(begin + level) == '=')
&& (sm.charAt(end - 1 - level) == '='))
{
level++;
}
}
catch (StringIndexOutOfBo... | [
"private",
"int",
"getSectionLevel",
"(",
"SpanManager",
"sm",
",",
"Span",
"sectionNameSpan",
")",
"{",
"int",
"begin",
"=",
"sectionNameSpan",
".",
"getStart",
"(",
")",
";",
"int",
"end",
"=",
"sectionNameSpan",
".",
"getEnd",
"(",
")",
";",
"int",
"lev... | Returns the number of Equality Chars which are used to specify the level
of the Section. | [
"Returns",
"the",
"number",
"of",
"Equality",
"Chars",
"which",
"are",
"used",
"to",
"specify",
"the",
"level",
"of",
"the",
"Section",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L754-L780 |
105,779 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.buildSectionStructure | private SectionContainer buildSectionStructure(List<SectionContent> scl)
{
SectionContainer result = new SectionContainer(0);
for (SectionContent sContent : scl)
{
int contentLevel = sContent.getLevel();
SectionContainer sContainer = result;
// get the right SectionContainer or create it
for (int c... | java | private SectionContainer buildSectionStructure(List<SectionContent> scl)
{
SectionContainer result = new SectionContainer(0);
for (SectionContent sContent : scl)
{
int contentLevel = sContent.getLevel();
SectionContainer sContainer = result;
// get the right SectionContainer or create it
for (int c... | [
"private",
"SectionContainer",
"buildSectionStructure",
"(",
"List",
"<",
"SectionContent",
">",
"scl",
")",
"{",
"SectionContainer",
"result",
"=",
"new",
"SectionContainer",
"(",
"0",
")",
";",
"for",
"(",
"SectionContent",
"sContent",
":",
"scl",
")",
"{",
... | Takes a list of SectionContent and returns a SectionContainer with the
given SectionContent s in the right structure. | [
"Takes",
"a",
"list",
"of",
"SectionContent",
"and",
"returns",
"a",
"SectionContainer",
"with",
"the",
"given",
"SectionContent",
"s",
"in",
"the",
"right",
"structure",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L786-L838 |
105,780 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.getLinkNameSpace | private static String getLinkNameSpace(String target)
{
int pos = target.indexOf(':');
if (pos == -1)
{
return null;
}
else
{
return target.substring(0, pos).replace('_', ' ').trim()
.toLowerCase();
}
} | java | private static String getLinkNameSpace(String target)
{
int pos = target.indexOf(':');
if (pos == -1)
{
return null;
}
else
{
return target.substring(0, pos).replace('_', ' ').trim()
.toLowerCase();
}
} | [
"private",
"static",
"String",
"getLinkNameSpace",
"(",
"String",
"target",
")",
"{",
"int",
"pos",
"=",
"target",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"pos",
"==",
"-",
"1",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return... | Returns the LOWERCASE NameSpace of the link target | [
"Returns",
"the",
"LOWERCASE",
"NameSpace",
"of",
"the",
"link",
"target"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L1506-L1518 |
105,781 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.parseQuotedSpans | private void parseQuotedSpans(SpanManager sm, Span s,
List<Span> quotedSpans, String quotation)
{
final int qlen = quotation.length();
// get the start position
int start = sm.indexOf(quotation, s.getStart(), s.getEnd());
while (start != -1)
{
// get the end position
int end = sm.indexOf(quotati... | java | private void parseQuotedSpans(SpanManager sm, Span s,
List<Span> quotedSpans, String quotation)
{
final int qlen = quotation.length();
// get the start position
int start = sm.indexOf(quotation, s.getStart(), s.getEnd());
while (start != -1)
{
// get the end position
int end = sm.indexOf(quotati... | [
"private",
"void",
"parseQuotedSpans",
"(",
"SpanManager",
"sm",
",",
"Span",
"s",
",",
"List",
"<",
"Span",
">",
"quotedSpans",
",",
"String",
"quotation",
")",
"{",
"final",
"int",
"qlen",
"=",
"quotation",
".",
"length",
"(",
")",
";",
"// get the start... | Searches the Range given by the Span s for the double occurence of
"quotation" and puts the results in the List quotedSpans. The Quotation
tags will be deleted.
@param sm
, the Source in which will be searched
@param s
, the range in which will be searched
@param quotedSpans
, the List where the Spans will be placed, ... | [
"Searches",
"the",
"Range",
"given",
"by",
"the",
"Span",
"s",
"for",
"the",
"double",
"occurence",
"of",
"quotation",
"and",
"puts",
"the",
"results",
"in",
"the",
"List",
"quotedSpans",
".",
"The",
"Quotation",
"tags",
"will",
"be",
"deleted",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L1669-L1706 |
105,782 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.parseBoldAndItalicSpans | private void parseBoldAndItalicSpans(SpanManager sm, Span line,
List<Span> boldSpans, List<Span> italicSpans)
{
// Das suchen nach BOLD und ITALIC muss in den Jeweiligen
// Zeilen geschenhen, da ein LineSeparator immer BOLD und
// Italic Tags schliesst.
// Bold Spans
parseQuotedSpans(sm, line, boldSpans,... | java | private void parseBoldAndItalicSpans(SpanManager sm, Span line,
List<Span> boldSpans, List<Span> italicSpans)
{
// Das suchen nach BOLD und ITALIC muss in den Jeweiligen
// Zeilen geschenhen, da ein LineSeparator immer BOLD und
// Italic Tags schliesst.
// Bold Spans
parseQuotedSpans(sm, line, boldSpans,... | [
"private",
"void",
"parseBoldAndItalicSpans",
"(",
"SpanManager",
"sm",
",",
"Span",
"line",
",",
"List",
"<",
"Span",
">",
"boldSpans",
",",
"List",
"<",
"Span",
">",
"italicSpans",
")",
"{",
"// Das suchen nach BOLD und ITALIC muss in den Jeweiligen",
"// Zeilen ges... | Searches a line for Bold and Italic quotations, this has to be done
linewhise. | [
"Searches",
"a",
"line",
"for",
"Bold",
"and",
"Italic",
"quotations",
"this",
"has",
"to",
"be",
"done",
"linewhise",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L1712-L1753 |
105,783 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.parseContentElement | @Override
public ContentElement parseContentElement(String src)
{
SpanManager sm = new SpanManager(src);
ContentElementParsingParameters cepp = new ContentElementParsingParameters();
parseImagesAndInternalLinks(sm, cepp.linkSpans, cepp.links);
LinkedList<Span> lineSpans = new LinkedList<Span>();
getLineSp... | java | @Override
public ContentElement parseContentElement(String src)
{
SpanManager sm = new SpanManager(src);
ContentElementParsingParameters cepp = new ContentElementParsingParameters();
parseImagesAndInternalLinks(sm, cepp.linkSpans, cepp.links);
LinkedList<Span> lineSpans = new LinkedList<Span>();
getLineSp... | [
"@",
"Override",
"public",
"ContentElement",
"parseContentElement",
"(",
"String",
"src",
")",
"{",
"SpanManager",
"sm",
"=",
"new",
"SpanManager",
"(",
"src",
")",
";",
"ContentElementParsingParameters",
"cepp",
"=",
"new",
"ContentElementParsingParameters",
"(",
"... | Building a ContentElement from a String | [
"Building",
"a",
"ContentElement",
"from",
"a",
"String"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L1763-L1775 |
105,784 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.parseContentElement | private ContentElement parseContentElement(SpanManager sm,
ContentElementParsingParameters cepp, Span lineSpan)
{
LinkedList<Span> lineSpans = new LinkedList<Span>();
lineSpans.add(lineSpan);
return parseContentElement(sm, cepp, lineSpans, new ContentElement());
} | java | private ContentElement parseContentElement(SpanManager sm,
ContentElementParsingParameters cepp, Span lineSpan)
{
LinkedList<Span> lineSpans = new LinkedList<Span>();
lineSpans.add(lineSpan);
return parseContentElement(sm, cepp, lineSpans, new ContentElement());
} | [
"private",
"ContentElement",
"parseContentElement",
"(",
"SpanManager",
"sm",
",",
"ContentElementParsingParameters",
"cepp",
",",
"Span",
"lineSpan",
")",
"{",
"LinkedList",
"<",
"Span",
">",
"lineSpans",
"=",
"new",
"LinkedList",
"<",
"Span",
">",
"(",
")",
";... | Building a ContentElement from a single line. | [
"Building",
"a",
"ContentElement",
"from",
"a",
"single",
"line",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L1780-L1786 |
105,785 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.sortLinks | private static List<Link> sortLinks(List<Link> links)
{
List<Link> result = new ArrayList<Link>();
for (Link l : links)
{
int pos = 0;
while (pos < result.size()
&& l.getPos().getStart() > result.get(pos).getPos()
.getStart())
{
pos++;
}
result.add(pos, l);
}
return result;
} | java | private static List<Link> sortLinks(List<Link> links)
{
List<Link> result = new ArrayList<Link>();
for (Link l : links)
{
int pos = 0;
while (pos < result.size()
&& l.getPos().getStart() > result.get(pos).getPos()
.getStart())
{
pos++;
}
result.add(pos, l);
}
return result;
} | [
"private",
"static",
"List",
"<",
"Link",
">",
"sortLinks",
"(",
"List",
"<",
"Link",
">",
"links",
")",
"{",
"List",
"<",
"Link",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Link",
">",
"(",
")",
";",
"for",
"(",
"Link",
"l",
":",
"links",
")"... | Sorts the Links... | [
"Sorts",
"the",
"Links",
"..."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L2028-L2043 |
105,786 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.sortTemplates | private static List<Template> sortTemplates(List<Template> templates)
{
List<Template> result = new ArrayList<Template>();
for (Template t : templates)
{
int pos = 0;
while (pos < result.size()
&& t.getPos().getStart() > result.get(pos).getPos()
.getStart())
{
pos++;
}
result.add(p... | java | private static List<Template> sortTemplates(List<Template> templates)
{
List<Template> result = new ArrayList<Template>();
for (Template t : templates)
{
int pos = 0;
while (pos < result.size()
&& t.getPos().getStart() > result.get(pos).getPos()
.getStart())
{
pos++;
}
result.add(p... | [
"private",
"static",
"List",
"<",
"Template",
">",
"sortTemplates",
"(",
"List",
"<",
"Template",
">",
"templates",
")",
"{",
"List",
"<",
"Template",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Template",
">",
"(",
")",
";",
"for",
"(",
"Template",
... | Sorts the Templates... | [
"Sorts",
"the",
"Templates",
"..."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java#L2048-L2063 |
105,787 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/ModularParser.java | ModularParser.setFirstParagraph | private void setFirstParagraph(ParsedPage pp)
{
int nr = pp.nrOfParagraphs();
// the paragraph with the lowest number, must not be the first, maybe it
// is only an Image...
for (int i = 0; i < nr; i++)
{
Paragraph p = pp.getParagraph(i);
// get the Text from the paragraph
SpanManager ptext = new ... | java | private void setFirstParagraph(ParsedPage pp)
{
int nr = pp.nrOfParagraphs();
// the paragraph with the lowest number, must not be the first, maybe it
// is only an Image...
for (int i = 0; i < nr; i++)
{
Paragraph p = pp.getParagraph(i);
// get the Text from the paragraph
SpanManager ptext = new ... | [
"private",
"void",
"setFirstParagraph",
"(",
"ParsedPage",
"pp",
")",
"{",
"int",
"nr",
"=",
"pp",
".",
"nrOfParagraphs",
"(",
")",
";",
"// the paragraph with the lowest number, must not be the first, maybe it",
"// is only an Image...",
"for",
"(",
"int",
"i",
"=",
... | Algorithm to identify the first paragraph of a ParsedPage | [
"Algorithm",
"to",
"identify",
"the",
"first",
"paragraph",
"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/mediawiki/ModularParser.java#L2068-L2131 |
105,788 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/ApiUtilities.java | ApiUtilities.printProgressInfo | public static void printProgressInfo(int counter, int size, int step, ProgressInfoMode mode, String text) {
if (size < step) {
return;
}
if (counter % (size / step) == 0) {
double progressPercent = counter * 100 / size;
progressPercent = 1 + Math.round(progre... | java | public static void printProgressInfo(int counter, int size, int step, ProgressInfoMode mode, String text) {
if (size < step) {
return;
}
if (counter % (size / step) == 0) {
double progressPercent = counter * 100 / size;
progressPercent = 1 + Math.round(progre... | [
"public",
"static",
"void",
"printProgressInfo",
"(",
"int",
"counter",
",",
"int",
"size",
",",
"int",
"step",
",",
"ProgressInfoMode",
"mode",
",",
"String",
"text",
")",
"{",
"if",
"(",
"size",
"<",
"step",
")",
"{",
"return",
";",
"}",
"if",
"(",
... | Prints a progress counter.
@param counter Indicates the position in the task.
@param size Size of the overall task.
@param step How many parts should the progress counter have?
@param mode Sets the output mode.
@param text The text that should be print along with the progress indicator. | [
"Prints",
"a",
"progress",
"counter",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/ApiUtilities.java#L44-L62 |
105,789 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.mwdumper/src/main/java/de/tudarmstadt/ukp/wikipedia/mwdumper/importer/SqlWriter.java | SqlWriter.bufferInsertRow | protected void bufferInsertRow(String table, Object[][] row) throws IOException {
StringBuffer sql = (StringBuffer)insertBuffers.get(table);
if (sql != null) {
if (traits.supportsMultiRowInsert() && (sql.length() < blockSize)) {
sql.append(',');
appendInsertValues(sql, row);
return;
} else {
f... | java | protected void bufferInsertRow(String table, Object[][] row) throws IOException {
StringBuffer sql = (StringBuffer)insertBuffers.get(table);
if (sql != null) {
if (traits.supportsMultiRowInsert() && (sql.length() < blockSize)) {
sql.append(',');
appendInsertValues(sql, row);
return;
} else {
f... | [
"protected",
"void",
"bufferInsertRow",
"(",
"String",
"table",
",",
"Object",
"[",
"]",
"[",
"]",
"row",
")",
"throws",
"IOException",
"{",
"StringBuffer",
"sql",
"=",
"(",
"StringBuffer",
")",
"insertBuffers",
".",
"get",
"(",
"table",
")",
";",
"if",
... | default 512k inserts | [
"default",
"512k",
"inserts"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.mwdumper/src/main/java/de/tudarmstadt/ukp/wikipedia/mwdumper/importer/SqlWriter.java#L176-L192 |
105,790 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoStorage.java | ChronoStorage.add | public void add(final Revision rev)
{
int revIndex = rev.getRevisionCounter();
if (this.mapping.containsKey(revIndex)) {
revIndex = this.mapping.get(revIndex);
}
// System.out.println("Store " + rev.getRevisionCounter() + " with " +
// revIndex);
ChronoFullRevision cfr = this.fullRevStorage.get(rev
... | java | public void add(final Revision rev)
{
int revIndex = rev.getRevisionCounter();
if (this.mapping.containsKey(revIndex)) {
revIndex = this.mapping.get(revIndex);
}
// System.out.println("Store " + rev.getRevisionCounter() + " with " +
// revIndex);
ChronoFullRevision cfr = this.fullRevStorage.get(rev
... | [
"public",
"void",
"add",
"(",
"final",
"Revision",
"rev",
")",
"{",
"int",
"revIndex",
"=",
"rev",
".",
"getRevisionCounter",
"(",
")",
";",
"if",
"(",
"this",
".",
"mapping",
".",
"containsKey",
"(",
"revIndex",
")",
")",
"{",
"revIndex",
"=",
"this",... | Adds a revision to the chrono storage.
@param rev
reference to the revision | [
"Adds",
"a",
"revision",
"to",
"the",
"chrono",
"storage",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoStorage.java#L102-L173 |
105,791 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoStorage.java | ChronoStorage.remove | public Revision remove()
{
ChronoStorageBlock block = first;
this.revisionIndex = block.getRevisionIndex();
ChronoStorageBlock next = block.getIndexNext();
this.first = next;
if (next != null) {
this.first.setIndexPrev(null);
}
else {
this.last = null;
}
/*
* System.out.println("Deliver ... | java | public Revision remove()
{
ChronoStorageBlock block = first;
this.revisionIndex = block.getRevisionIndex();
ChronoStorageBlock next = block.getIndexNext();
this.first = next;
if (next != null) {
this.first.setIndexPrev(null);
}
else {
this.last = null;
}
/*
* System.out.println("Deliver ... | [
"public",
"Revision",
"remove",
"(",
")",
"{",
"ChronoStorageBlock",
"block",
"=",
"first",
";",
"this",
".",
"revisionIndex",
"=",
"block",
".",
"getRevisionIndex",
"(",
")",
";",
"ChronoStorageBlock",
"next",
"=",
"block",
".",
"getIndexNext",
"(",
")",
";... | Removes a revision from the chrono storage.
@return | [
"Removes",
"a",
"revision",
"from",
"the",
"chrono",
"storage",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoStorage.java#L190-L225 |
105,792 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoStorage.java | ChronoStorage.get | public Revision get(final int revisionIndex)
{
if (this.storage.containsKey(revisionIndex)) {
ChronoStorageBlock block = this.storage.get(revisionIndex);
return block.getRev();
}
return null;
} | java | public Revision get(final int revisionIndex)
{
if (this.storage.containsKey(revisionIndex)) {
ChronoStorageBlock block = this.storage.get(revisionIndex);
return block.getRev();
}
return null;
} | [
"public",
"Revision",
"get",
"(",
"final",
"int",
"revisionIndex",
")",
"{",
"if",
"(",
"this",
".",
"storage",
".",
"containsKey",
"(",
"revisionIndex",
")",
")",
"{",
"ChronoStorageBlock",
"block",
"=",
"this",
".",
"storage",
".",
"get",
"(",
"revisionI... | Returns the revision of the specified chrono storage block.
@param revisionIndex
chronological order index
@return | [
"Returns",
"the",
"revision",
"of",
"the",
"specified",
"chrono",
"storage",
"block",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoStorage.java#L262-L270 |
105,793 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoStorage.java | ChronoStorage.clean | public void clean()
{
ChronoFullRevision cfr = firstCFR;
totalSize = size;
while (cfr != null) {
totalSize += cfr.size();
cfr = cfr.getNext();
}
if (totalSize < MAX_STORAGE_SIZE) {
return;
}
cfr = firstCFR;
while (cfr != null) {
totalSize += cfr.clean(revisionIndex, 0);
cfr = cfr.getN... | java | public void clean()
{
ChronoFullRevision cfr = firstCFR;
totalSize = size;
while (cfr != null) {
totalSize += cfr.size();
cfr = cfr.getNext();
}
if (totalSize < MAX_STORAGE_SIZE) {
return;
}
cfr = firstCFR;
while (cfr != null) {
totalSize += cfr.clean(revisionIndex, 0);
cfr = cfr.getN... | [
"public",
"void",
"clean",
"(",
")",
"{",
"ChronoFullRevision",
"cfr",
"=",
"firstCFR",
";",
"totalSize",
"=",
"size",
";",
"while",
"(",
"cfr",
"!=",
"null",
")",
"{",
"totalSize",
"+=",
"cfr",
".",
"size",
"(",
")",
";",
"cfr",
"=",
"cfr",
".",
"... | Reduces the amount of used storage by discarding chrono storage blocks. | [
"Reduces",
"the",
"amount",
"of",
"used",
"storage",
"by",
"discarding",
"chrono",
"storage",
"blocks",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoStorage.java#L278-L332 |
105,794 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/BitWriter.java | BitWriter.write | private void write(final int val)
throws EncodingException
{
if (val < 0 || val > 255) {
throw ErrorFactory.createEncodingException(
ErrorKeys.DIFFTOOL_ENCODING_VALUE_OUT_OF_RANGE,
"byte value out of range: " + val);
}
this.stream.write(val);
} | java | private void write(final int val)
throws EncodingException
{
if (val < 0 || val > 255) {
throw ErrorFactory.createEncodingException(
ErrorKeys.DIFFTOOL_ENCODING_VALUE_OUT_OF_RANGE,
"byte value out of range: " + val);
}
this.stream.write(val);
} | [
"private",
"void",
"write",
"(",
"final",
"int",
"val",
")",
"throws",
"EncodingException",
"{",
"if",
"(",
"val",
"<",
"0",
"||",
"val",
">",
"255",
")",
"{",
"throw",
"ErrorFactory",
".",
"createEncodingException",
"(",
"ErrorKeys",
".",
"DIFFTOOL_ENCODING... | Writes a byte to the buffer.
@param val
an integer representing a full byte
@throws EncodingException
if the value is out range | [
"Writes",
"a",
"byte",
"to",
"the",
"buffer",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/BitWriter.java#L73-L84 |
105,795 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/BitWriter.java | BitWriter.writeBit | public void writeBit(final int bit)
throws EncodingException
{
if (bit != 0 && bit != 1) {
throw ErrorFactory.createEncodingException(
ErrorKeys.DIFFTOOL_ENCODING_VALUE_OUT_OF_RANGE,
"bit value out of range: " + bit);
}
this.buffer |= bit << (7 - this.bufferLength);
this.bufferLength++;
if ... | java | public void writeBit(final int bit)
throws EncodingException
{
if (bit != 0 && bit != 1) {
throw ErrorFactory.createEncodingException(
ErrorKeys.DIFFTOOL_ENCODING_VALUE_OUT_OF_RANGE,
"bit value out of range: " + bit);
}
this.buffer |= bit << (7 - this.bufferLength);
this.bufferLength++;
if ... | [
"public",
"void",
"writeBit",
"(",
"final",
"int",
"bit",
")",
"throws",
"EncodingException",
"{",
"if",
"(",
"bit",
"!=",
"0",
"&&",
"bit",
"!=",
"1",
")",
"{",
"throw",
"ErrorFactory",
".",
"createEncodingException",
"(",
"ErrorKeys",
".",
"DIFFTOOL_ENCODI... | Writes a single bit to the buffer.
@param bit
0 or 1
@throws EncodingException
if the input is neither 0 nor 1. | [
"Writes",
"a",
"single",
"bit",
"to",
"the",
"buffer",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/BitWriter.java#L94-L114 |
105,796 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/BitWriter.java | BitWriter.writeValue | public void writeValue(final int length, final int value)
throws EncodingException
{
if (length > 31) {
throw ErrorFactory.createEncodingException(
ErrorKeys.DIFFTOOL_ENCODING_VALUE_OUT_OF_RANGE,
"more than maximum length: " + value);
}
for (int i = length - 1; i >= 0; i--) {
writeBit((value >... | java | public void writeValue(final int length, final int value)
throws EncodingException
{
if (length > 31) {
throw ErrorFactory.createEncodingException(
ErrorKeys.DIFFTOOL_ENCODING_VALUE_OUT_OF_RANGE,
"more than maximum length: " + value);
}
for (int i = length - 1; i >= 0; i--) {
writeBit((value >... | [
"public",
"void",
"writeValue",
"(",
"final",
"int",
"length",
",",
"final",
"int",
"value",
")",
"throws",
"EncodingException",
"{",
"if",
"(",
"length",
">",
"31",
")",
"{",
"throw",
"ErrorFactory",
".",
"createEncodingException",
"(",
"ErrorKeys",
".",
"D... | Writes a positive integer to the buffer.
@param length
the number of bits to write
@param value
an integer value
@throws EncodingException
if the length of the input is more than 31 bits. | [
"Writes",
"a",
"positive",
"integer",
"to",
"the",
"buffer",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/BitWriter.java#L127-L139 |
105,797 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/BitWriter.java | BitWriter.write | public void write(final byte[] bText)
throws EncodingException
{
writeFillBits();
int l = bText.length;
for (int i = 0; i < l; i++) {
write(0xFF & bText[i]);
}
} | java | public void write(final byte[] bText)
throws EncodingException
{
writeFillBits();
int l = bText.length;
for (int i = 0; i < l; i++) {
write(0xFF & bText[i]);
}
} | [
"public",
"void",
"write",
"(",
"final",
"byte",
"[",
"]",
"bText",
")",
"throws",
"EncodingException",
"{",
"writeFillBits",
"(",
")",
";",
"int",
"l",
"=",
"bText",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"l",
";",
... | Writes the byte array to the buffer. The currently used buffer will be
filled with zero bits before is is written in front of the byte-array.
@param bText
byte array
@throws EncodingException
if the writing fails | [
"Writes",
"the",
"byte",
"array",
"to",
"the",
"buffer",
".",
"The",
"currently",
"used",
"buffer",
"will",
"be",
"filled",
"with",
"zero",
"bits",
"before",
"is",
"is",
"written",
"in",
"front",
"of",
"the",
"byte",
"-",
"array",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/BitWriter.java#L151-L161 |
105,798 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/OS.java | OS.getOsType | public static String getOsType() {
String osType = "unknown";
String osName = System.getProperty("os.name");
if (osName.contains("Windows")) {
osType = "Windows";
}
else if (osName.contains("Linux")) {
osType = "Linux";
}
return osType;
... | java | public static String getOsType() {
String osType = "unknown";
String osName = System.getProperty("os.name");
if (osName.contains("Windows")) {
osType = "Windows";
}
else if (osName.contains("Linux")) {
osType = "Linux";
}
return osType;
... | [
"public",
"static",
"String",
"getOsType",
"(",
")",
"{",
"String",
"osType",
"=",
"\"unknown\"",
";",
"String",
"osName",
"=",
"System",
".",
"getProperty",
"(",
"\"os.name\"",
")",
";",
"if",
"(",
"osName",
".",
"contains",
"(",
"\"Windows\"",
")",
")",
... | Tries to determine the tpye of OS the application is running on.
At the moment only Windows and Linux are supported.
@return The type of OS the application is running on. Or "unknown" if the system is unknown. | [
"Tries",
"to",
"determine",
"the",
"tpye",
"of",
"OS",
"the",
"application",
"is",
"running",
"on",
".",
"At",
"the",
"moment",
"only",
"Windows",
"and",
"Linux",
"are",
"supported",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/OS.java#L26-L36 |
105,799 | dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/OS.java | OS.getUsedMemory | public static double getUsedMemory() {
Runtime rt = Runtime.getRuntime();
long memLong = rt.totalMemory() - rt.freeMemory();
double memDouble = memLong / (1024.0 * 1024.0);
memDouble = Math.round(memDouble * 100) / 100.0;
return memDouble;
} | java | public static double getUsedMemory() {
Runtime rt = Runtime.getRuntime();
long memLong = rt.totalMemory() - rt.freeMemory();
double memDouble = memLong / (1024.0 * 1024.0);
memDouble = Math.round(memDouble * 100) / 100.0;
return memDouble;
} | [
"public",
"static",
"double",
"getUsedMemory",
"(",
")",
"{",
"Runtime",
"rt",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
";",
"long",
"memLong",
"=",
"rt",
".",
"totalMemory",
"(",
")",
"-",
"rt",
".",
"freeMemory",
"(",
")",
";",
"double",
"memDoub... | Gets the memory used by the JVM in MB.
@return Returns how much memory (in MB) is used by the JVM at the moment. | [
"Gets",
"the",
"memory",
"used",
"by",
"the",
"JVM",
"in",
"MB",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/util/OS.java#L41-L48 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.