repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/AnnisServiceRunner.java
AnnisServiceRunner.start
public void start(boolean rethrowExceptions) throws Exception { log.info("Starting up REST..."); try { createWebServer(); if (server == null) { isShutdownRequested = true; errorCode = 100; } else { server.start(); } } catch (Except...
java
public void start(boolean rethrowExceptions) throws Exception { log.info("Starting up REST..."); try { createWebServer(); if (server == null) { isShutdownRequested = true; errorCode = 100; } else { server.start(); } } catch (Except...
[ "public", "void", "start", "(", "boolean", "rethrowExceptions", ")", "throws", "Exception", "{", "log", ".", "info", "(", "\"Starting up REST...\"", ")", ";", "try", "{", "createWebServer", "(", ")", ";", "if", "(", "server", "==", "null", ")", "{", "isShu...
Creates and starts the server @param rethrowExceptions Set to true if you want to get exceptions re-thrown to parent
[ "Creates", "and", "starts", "the", "server" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/AnnisServiceRunner.java#L289-L324
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/AnnisServiceRunner.java
AnnisServiceRunner.setTimeout
public void setTimeout(int milliseconds) { if(ctx != null) { QueryDao dao = (QueryDao) ctx.getBean("queryDao"); if(dao != null) { dao.setTimeout(milliseconds); } } }
java
public void setTimeout(int milliseconds) { if(ctx != null) { QueryDao dao = (QueryDao) ctx.getBean("queryDao"); if(dao != null) { dao.setTimeout(milliseconds); } } }
[ "public", "void", "setTimeout", "(", "int", "milliseconds", ")", "{", "if", "(", "ctx", "!=", "null", ")", "{", "QueryDao", "dao", "=", "(", "QueryDao", ")", "ctx", ".", "getBean", "(", "\"queryDao\"", ")", ";", "if", "(", "dao", "!=", "null", ")", ...
Set the timeout in milliseconds @param milliseconds Timeout if greater than zero, disabled timeout if less then zero.
[ "Set", "the", "timeout", "in", "milliseconds" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/AnnisServiceRunner.java#L353-L363
train
korpling/ANNIS
annis-service/src/main/java/annis/utils/ANNISFormatHelper.java
ANNISFormatHelper.corporaInZipfile
public static Map<String, ZipEntry> corporaInZipfile(ZipFile zip) throws IOException { Map<String, ZipEntry> result = new HashMap<>(); for(ZipEntry e : getANNISEntry(zip, "corpus")) { String name = extractToplevelCorpusNames(zip.getInputStream(e)); result.put(name, e); } retu...
java
public static Map<String, ZipEntry> corporaInZipfile(ZipFile zip) throws IOException { Map<String, ZipEntry> result = new HashMap<>(); for(ZipEntry e : getANNISEntry(zip, "corpus")) { String name = extractToplevelCorpusNames(zip.getInputStream(e)); result.put(name, e); } retu...
[ "public", "static", "Map", "<", "String", ",", "ZipEntry", ">", "corporaInZipfile", "(", "ZipFile", "zip", ")", "throws", "IOException", "{", "Map", "<", "String", ",", "ZipEntry", ">", "result", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", ...
List all corpora of a ZIP file and their paths. @param zip @return @throws IOException
[ "List", "all", "corpora", "of", "a", "ZIP", "file", "and", "their", "paths", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/utils/ANNISFormatHelper.java#L56-L67
train
korpling/ANNIS
annis-service/src/main/java/annis/utils/ANNISFormatHelper.java
ANNISFormatHelper.extractToplevelCorpusNames
public static String extractToplevelCorpusNames(InputStream corpusTabContent) { String result = null; try(CSVReader csv = new CSVReader(new InputStreamReader( corpusTabContent, "UTF-8"), '\t')) { String[] line; int maxPost = Integer.MIN_VALUE; int minPre = Integer.MAX_VAL...
java
public static String extractToplevelCorpusNames(InputStream corpusTabContent) { String result = null; try(CSVReader csv = new CSVReader(new InputStreamReader( corpusTabContent, "UTF-8"), '\t')) { String[] line; int maxPost = Integer.MIN_VALUE; int minPre = Integer.MAX_VAL...
[ "public", "static", "String", "extractToplevelCorpusNames", "(", "InputStream", "corpusTabContent", ")", "{", "String", "result", "=", "null", ";", "try", "(", "CSVReader", "csv", "=", "new", "CSVReader", "(", "new", "InputStreamReader", "(", "corpusTabContent", "...
Extract the name of the toplevel corpus from the content of the corpus.tab file. @param corpusTabContent @return
[ "Extract", "the", "name", "of", "the", "toplevel", "corpus", "from", "the", "content", "of", "the", "corpus", ".", "tab", "file", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/utils/ANNISFormatHelper.java#L111-L148
train
korpling/ANNIS
annis-service/src/main/java/annis/utils/ANNISFormatHelper.java
ANNISFormatHelper.getANNISEntry
public static List<ZipEntry> getANNISEntry(ZipFile file, String table, String ... fileEndings) { List<ZipEntry> allMatchingEntries = new ArrayList<>(); if (fileEndings == null || fileEndings.length == 0) { fileEndings = new String[] {"tab", "annis"}; } final List<String> fullNa...
java
public static List<ZipEntry> getANNISEntry(ZipFile file, String table, String ... fileEndings) { List<ZipEntry> allMatchingEntries = new ArrayList<>(); if (fileEndings == null || fileEndings.length == 0) { fileEndings = new String[] {"tab", "annis"}; } final List<String> fullNa...
[ "public", "static", "List", "<", "ZipEntry", ">", "getANNISEntry", "(", "ZipFile", "file", ",", "String", "table", ",", "String", "...", "fileEndings", ")", "{", "List", "<", "ZipEntry", ">", "allMatchingEntries", "=", "new", "ArrayList", "<>", "(", ")", "...
Find the directories containing the real ANNIS tab files for a zip file. @param file @param table The table to search for. @param fileEndings The possible endings of corpus tab files (if null "tab" and "annis" are used as default. @return
[ "Find", "the", "directories", "containing", "the", "real", "ANNIS", "tab", "files", "for", "a", "zip", "file", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/utils/ANNISFormatHelper.java#L159-L196
train
korpling/ANNIS
annis-service/src/main/java/annis/ql/parser/JoinListener.java
JoinListener.join
private void join(ParserRuleContext ctx, Class<? extends Join> type) { QueryNode left = relationChain.get(relationIdx); QueryNode right = relationChain.get(relationIdx+1); try { Constructor<? extends Join> c = type.getConstructor(QueryNode.class); Join newJoin = c.newInstance(right); ...
java
private void join(ParserRuleContext ctx, Class<? extends Join> type) { QueryNode left = relationChain.get(relationIdx); QueryNode right = relationChain.get(relationIdx+1); try { Constructor<? extends Join> c = type.getConstructor(QueryNode.class); Join newJoin = c.newInstance(right); ...
[ "private", "void", "join", "(", "ParserRuleContext", "ctx", ",", "Class", "<", "?", "extends", "Join", ">", "type", ")", "{", "QueryNode", "left", "=", "relationChain", ".", "get", "(", "relationIdx", ")", ";", "QueryNode", "right", "=", "relationChain", "...
Automatically create a join from a node and a join class. This will automatically get the left and right hand refs and will construct a new join specified by the type using reflection. It will also add an parsed location to the join. @node @type00
[ "Automatically", "create", "a", "join", "from", "a", "node", "and", "a", "join", "class", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/ql/parser/JoinListener.java#L566-L595
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.analyzeTextTable
private void analyzeTextTable(String toplevelCorpusName) { List<String> rawTexts = getQueryDao().getRawText(toplevelCorpusName); // pattern for checking the token layer final Pattern WHITESPACE_MATCHER = Pattern.compile("^\\s+$"); for (String s : rawTexts) { if (s != null && WHITESPACE_MA...
java
private void analyzeTextTable(String toplevelCorpusName) { List<String> rawTexts = getQueryDao().getRawText(toplevelCorpusName); // pattern for checking the token layer final Pattern WHITESPACE_MATCHER = Pattern.compile("^\\s+$"); for (String s : rawTexts) { if (s != null && WHITESPACE_MA...
[ "private", "void", "analyzeTextTable", "(", "String", "toplevelCorpusName", ")", "{", "List", "<", "String", ">", "rawTexts", "=", "getQueryDao", "(", ")", ".", "getRawText", "(", "toplevelCorpusName", ")", ";", "// pattern for checking the token layer", "final", "P...
Searches for textes which are empty or only contains whitespaces. If that is the case the visualizer and no document visualizer are defined in the corpus properties file a new file is created and stores a new config which disables document browsing. @param corpusID The id of the corpus which texts are analyzed.
[ "Searches", "for", "textes", "which", "are", "empty", "or", "only", "contains", "whitespaces", ".", "If", "that", "is", "the", "case", "the", "visualizer", "and", "no", "document", "visualizer", "are", "defined", "in", "the", "corpus", "properties", "file", ...
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L113-L161
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.init
public void init() { AnnotationIntrospector introspector = new JaxbAnnotationIntrospector(); jsonMapper.setAnnotationIntrospector(introspector); // the json should be as compact as possible in the database jsonMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, false); }
java
public void init() { AnnotationIntrospector introspector = new JaxbAnnotationIntrospector(); jsonMapper.setAnnotationIntrospector(introspector); // the json should be as compact as possible in the database jsonMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, false); }
[ "public", "void", "init", "(", ")", "{", "AnnotationIntrospector", "introspector", "=", "new", "JaxbAnnotationIntrospector", "(", ")", ";", "jsonMapper", ".", "setAnnotationIntrospector", "(", "introspector", ")", ";", "// the json should be as compact as possible in the da...
Called when Spring configuration finished
[ "Called", "when", "Spring", "configuration", "finished" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L237-L244
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.getDatabaseSchemaVersion
@Transactional(readOnly = true, propagation = Propagation.REQUIRED) public String getDatabaseSchemaVersion() { try { List<Map<String, Object>> result = getJdbcTemplate(). queryForList( "SELECT \"value\" FROM repository_metadata WHERE \"name\"='schema-version'"); String schema...
java
@Transactional(readOnly = true, propagation = Propagation.REQUIRED) public String getDatabaseSchemaVersion() { try { List<Map<String, Object>> result = getJdbcTemplate(). queryForList( "SELECT \"value\" FROM repository_metadata WHERE \"name\"='schema-version'"); String schema...
[ "@", "Transactional", "(", "readOnly", "=", "true", ",", "propagation", "=", "Propagation", ".", "REQUIRED", ")", "public", "String", "getDatabaseSchemaVersion", "(", ")", "{", "try", "{", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "result...
Get the real schema name and version as used by the database. @return
[ "Get", "the", "real", "schema", "name", "and", "version", "as", "used", "by", "the", "database", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L360-L381
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.importCorpus
@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED) public boolean importCorpus(String path, String aliasName, boolean overwrite, boolean waitForOtherTasks) { // check schema version first checkDatabaseSchemaVersion(); if (!loc...
java
@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED) public boolean importCorpus(String path, String aliasName, boolean overwrite, boolean waitForOtherTasks) { // check schema version first checkDatabaseSchemaVersion(); if (!loc...
[ "@", "Transactional", "(", "readOnly", "=", "false", ",", "propagation", "=", "Propagation", ".", "REQUIRES_NEW", ",", "isolation", "=", "Isolation", ".", "READ_COMMITTED", ")", "public", "boolean", "importCorpus", "(", "String", "path", ",", "String", "aliasNam...
Reads ANNIS files from several directories. @param path Specifies the path to the corpora, which should be imported. @param aliasName An alias name for this corpus. Can be null. @param overwrite If set to true conflicting top level corpora are deleted. @param waitForOtherTasks If true wait for other tasks to finish, i...
[ "Reads", "ANNIS", "files", "from", "several", "directories", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L534-L568
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.importSingleFile
private void importSingleFile(String file, String toplevelCorpusName, long corpusRef) { BinaryImportHelper preStat = new BinaryImportHelper(file, getRealDataDir(), toplevelCorpusName, corpusRef, mimeTypeMapping); getJdbcTemplate().execute(BinaryImportHelper.SQL, preStat); }
java
private void importSingleFile(String file, String toplevelCorpusName, long corpusRef) { BinaryImportHelper preStat = new BinaryImportHelper(file, getRealDataDir(), toplevelCorpusName, corpusRef, mimeTypeMapping); getJdbcTemplate().execute(BinaryImportHelper.SQL, preStat); }
[ "private", "void", "importSingleFile", "(", "String", "file", ",", "String", "toplevelCorpusName", ",", "long", "corpusRef", ")", "{", "BinaryImportHelper", "preStat", "=", "new", "BinaryImportHelper", "(", "file", ",", "getRealDataDir", "(", ")", ",", "toplevelCo...
Imports a single binary file. @param file Specifies the file to be imported. @param corpusRef Assigns the file this corpus. @param toplevelCorpusName The toplevel corpus name
[ "Imports", "a", "single", "binary", "file", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L1024-L1033
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.cleanupData
@Transactional(readOnly = true) public void cleanupData() { List<String> allFilesInDatabaseList = getJdbcTemplate().queryForList( "SELECT filename FROM media_files AS m", String.class); File dataDir = getRealDataDir(); Set<File> allFilesInDatabase = new HashSet<>(); for (String singleFileNa...
java
@Transactional(readOnly = true) public void cleanupData() { List<String> allFilesInDatabaseList = getJdbcTemplate().queryForList( "SELECT filename FROM media_files AS m", String.class); File dataDir = getRealDataDir(); Set<File> allFilesInDatabase = new HashSet<>(); for (String singleFileNa...
[ "@", "Transactional", "(", "readOnly", "=", "true", ")", "public", "void", "cleanupData", "(", ")", "{", "List", "<", "String", ">", "allFilesInDatabaseList", "=", "getJdbcTemplate", "(", ")", ".", "queryForList", "(", "\"SELECT filename FROM media_files AS m\"", ...
Delete files not used by this instance in the data directory.
[ "Delete", "files", "not", "used", "by", "this", "instance", "in", "the", "data", "directory", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L1421-L1452
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.listCorpusStats
public List<Map<String, Object>> listCorpusStats(File databaseProperties) { List<Map<String, Object>> result = new LinkedList<>(); DataSource origDataSource = getDataSource().getInnerDataSource(); try { if (databaseProperties != null) { getDataSource().setInnerDataSource(createDat...
java
public List<Map<String, Object>> listCorpusStats(File databaseProperties) { List<Map<String, Object>> result = new LinkedList<>(); DataSource origDataSource = getDataSource().getInnerDataSource(); try { if (databaseProperties != null) { getDataSource().setInnerDataSource(createDat...
[ "public", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "listCorpusStats", "(", "File", "databaseProperties", ")", "{", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "result", "=", "new", "LinkedList", "<>", "(", ")", ";", ...
Lists the corpora using the connection information of a given "database.properties". file @param databaseProperties @return
[ "Lists", "the", "corpora", "using", "the", "connection", "information", "of", "a", "given", "database", ".", "properties", ".", "file" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L1467-L1499
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.listCorpusAlias
public Multimap<String, String> listCorpusAlias(File databaseProperties) { Multimap<String, String> result = TreeMultimap.create(); DataSource origDataSource = getDataSource().getInnerDataSource(); try { if (databaseProperties != null) { getDataSource().setInnerDataSource(createDa...
java
public Multimap<String, String> listCorpusAlias(File databaseProperties) { Multimap<String, String> result = TreeMultimap.create(); DataSource origDataSource = getDataSource().getInnerDataSource(); try { if (databaseProperties != null) { getDataSource().setInnerDataSource(createDa...
[ "public", "Multimap", "<", "String", ",", "String", ">", "listCorpusAlias", "(", "File", "databaseProperties", ")", "{", "Multimap", "<", "String", ",", "String", ">", "result", "=", "TreeMultimap", ".", "create", "(", ")", ";", "DataSource", "origDataSource",...
Provides a list where the keys are the aliases and the values are the corpus names. @param databaseProperties @return
[ "Provides", "a", "list", "where", "the", "keys", "are", "the", "aliases", "and", "the", "values", "are", "the", "corpus", "names", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L1520-L1574
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.bulkloadTableFromResource
private void bulkloadTableFromResource(String table, Resource resource) { log.debug("bulk-loading data from '" + resource.getFilename() + "' into table '" + table + "'"); String sql = "COPY \"" + table + "\" FROM STDIN WITH DELIMITER E'\t' NULL AS 'NULL'"; try { // retrieve the curr...
java
private void bulkloadTableFromResource(String table, Resource resource) { log.debug("bulk-loading data from '" + resource.getFilename() + "' into table '" + table + "'"); String sql = "COPY \"" + table + "\" FROM STDIN WITH DELIMITER E'\t' NULL AS 'NULL'"; try { // retrieve the curr...
[ "private", "void", "bulkloadTableFromResource", "(", "String", "table", ",", "Resource", "resource", ")", "{", "log", ".", "debug", "(", "\"bulk-loading data from '\"", "+", "resource", ".", "getFilename", "(", ")", "+", "\"' into table '\"", "+", "table", "+", ...
bulk-loads a table from a resource
[ "bulk", "-", "loads", "a", "table", "from", "a", "resource" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L1694-L1730
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.listIndexesOnTables
private List<String> listIndexesOnTables(List<String> tables) { String sql = "" + "SELECT indexname " + "FROM pg_indexes " + "WHERE tablename IN (" + StringUtils.repeat("?", ",", tables.size()) + ") " + "AND lower(indexname) NOT IN " + " (SELECT lower(conname) FROM pg_con...
java
private List<String> listIndexesOnTables(List<String> tables) { String sql = "" + "SELECT indexname " + "FROM pg_indexes " + "WHERE tablename IN (" + StringUtils.repeat("?", ",", tables.size()) + ") " + "AND lower(indexname) NOT IN " + " (SELECT lower(conname) FROM pg_con...
[ "private", "List", "<", "String", ">", "listIndexesOnTables", "(", "List", "<", "String", ">", "tables", ")", "{", "String", "sql", "=", "\"\"", "+", "\"SELECT indexname \"", "+", "\"FROM pg_indexes \"", "+", "\"WHERE tablename IN (\"", "+", "StringUtils", ".", ...
exploits the fact that the index has the same name as the constraint
[ "exploits", "the", "fact", "that", "the", "index", "has", "the", "same", "name", "as", "the", "constraint" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L1781-L1793
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.getTopLevelCorpusFromTmpArea
private String getTopLevelCorpusFromTmpArea() { String sql = "SELECT name FROM " + tableInStagingArea("corpus") + " WHERE type='CORPUS'\n" + "AND pre = (SELECT min(pre) FROM " + tableInStagingArea("corpus") + ")\n" + "AND post = (SELECT max(post) FROM " + tableInStagingArea("corpus") ...
java
private String getTopLevelCorpusFromTmpArea() { String sql = "SELECT name FROM " + tableInStagingArea("corpus") + " WHERE type='CORPUS'\n" + "AND pre = (SELECT min(pre) FROM " + tableInStagingArea("corpus") + ")\n" + "AND post = (SELECT max(post) FROM " + tableInStagingArea("corpus") ...
[ "private", "String", "getTopLevelCorpusFromTmpArea", "(", ")", "{", "String", "sql", "=", "\"SELECT name FROM \"", "+", "tableInStagingArea", "(", "\"corpus\"", ")", "+", "\" WHERE type='CORPUS'\\n\"", "+", "\"AND pre = (SELECT min(pre) FROM \"", "+", "tableInStagingArea", ...
Retrieves the name of the top level corpus in the corpus.tab file. <p> At this point, the tab files must be in the staging area.</p> @return The name of the toplevel corpus or an empty String if no top level corpus is found.
[ "Retrieves", "the", "name", "of", "the", "top", "level", "corpus", "in", "the", "corpus", ".", "tab", "file", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L1870-L1895
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.importResolverVisMapTable
private void importResolverVisMapTable(String path, String table, String annisFileSuffix) { try { // count cols for detecting old resolver_vis_map table format File resolver_vis_tab = new File(path, table + annisFileSuffix); if (!resolver_vis_tab.isFile()) { return; } ...
java
private void importResolverVisMapTable(String path, String table, String annisFileSuffix) { try { // count cols for detecting old resolver_vis_map table format File resolver_vis_tab = new File(path, table + annisFileSuffix); if (!resolver_vis_tab.isFile()) { return; } ...
[ "private", "void", "importResolverVisMapTable", "(", "String", "path", ",", "String", "table", ",", "String", "annisFileSuffix", ")", "{", "try", "{", "// count cols for detecting old resolver_vis_map table format", "File", "resolver_vis_tab", "=", "new", "File", "(", "...
Imported the old and the new version of the resolver_vis_map.tab. The new version has an additional column for visibility status of the visualization. @param path The path to the ANNIS file. @param table The final table in the database of the resolver_vis_map table.
[ "Imported", "the", "old", "and", "the", "new", "version", "of", "the", "resolver_vis_map", ".", "tab", ".", "The", "new", "version", "has", "an", "additional", "column", "for", "visibility", "status", "of", "the", "visualization", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L2013-L2062
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.fixResolverVisMapTable
private void fixResolverVisMapTable(String toplevelCorpus, String table) { log.info("checking resolver_vis_map for errors"); // delete all entries that reference a different corpus than the imported one int invalidRows = getJdbcTemplate().update("DELETE FROM " + table + " WHERE corpus <> ?", toplev...
java
private void fixResolverVisMapTable(String toplevelCorpus, String table) { log.info("checking resolver_vis_map for errors"); // delete all entries that reference a different corpus than the imported one int invalidRows = getJdbcTemplate().update("DELETE FROM " + table + " WHERE corpus <> ?", toplev...
[ "private", "void", "fixResolverVisMapTable", "(", "String", "toplevelCorpus", ",", "String", "table", ")", "{", "log", ".", "info", "(", "\"checking resolver_vis_map for errors\"", ")", ";", "// delete all entries that reference a different corpus than the imported one", "int",...
Removes any unwanted entries from the resolver_vis_map table @param toplevelCorpus @param table
[ "Removes", "any", "unwanted", "entries", "from", "the", "resolver_vis_map", "table" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L2070-L2083
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.analyzeAutoGeneratedQueries
private void analyzeAutoGeneratedQueries(long corpusID) { // read the example queries from the staging area List<ExampleQuery> exampleQueries = getJdbcTemplate().query( "SELECT * FROM _" + EXAMPLE_QUERIES_TAB, new RowMapper<ExampleQuery>() { @Override public ExampleQuery mapRow(Res...
java
private void analyzeAutoGeneratedQueries(long corpusID) { // read the example queries from the staging area List<ExampleQuery> exampleQueries = getJdbcTemplate().query( "SELECT * FROM _" + EXAMPLE_QUERIES_TAB, new RowMapper<ExampleQuery>() { @Override public ExampleQuery mapRow(Res...
[ "private", "void", "analyzeAutoGeneratedQueries", "(", "long", "corpusID", ")", "{", "// read the example queries from the staging area", "List", "<", "ExampleQuery", ">", "exampleQueries", "=", "getJdbcTemplate", "(", ")", ".", "query", "(", "\"SELECT * FROM _\"", "+", ...
Counts nodes and operators of the AQL example query and writes it back to the staging area. @param corpusID specifies the corpus, the analyze things.
[ "Counts", "nodes", "and", "operators", "of", "the", "AQL", "example", "query", "and", "writes", "it", "back", "to", "the", "staging", "area", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L2122-L2144
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.countExampleQueryNodes
private void countExampleQueryNodes(List<ExampleQuery> exampleQueries) { for (ExampleQuery eQ : exampleQueries) { QueryData query = getQueryDao().parseAQL(eQ.getExampleQuery(), null); int count = 0; for (List<QueryNode> qNodes : query.getAlternatives()) { count += qNodes.siz...
java
private void countExampleQueryNodes(List<ExampleQuery> exampleQueries) { for (ExampleQuery eQ : exampleQueries) { QueryData query = getQueryDao().parseAQL(eQ.getExampleQuery(), null); int count = 0; for (List<QueryNode> qNodes : query.getAlternatives()) { count += qNodes.siz...
[ "private", "void", "countExampleQueryNodes", "(", "List", "<", "ExampleQuery", ">", "exampleQueries", ")", "{", "for", "(", "ExampleQuery", "eQ", ":", "exampleQueries", ")", "{", "QueryData", "query", "=", "getQueryDao", "(", ")", ".", "parseAQL", "(", "eQ", ...
Maps example queries to integer, which represents the amount of nodes of the aql query.
[ "Maps", "example", "queries", "to", "integer", "which", "represents", "the", "amount", "of", "nodes", "of", "the", "aql", "query", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L2151-L2167
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.writeAmountOfNodesBack
private void writeAmountOfNodesBack(List<ExampleQuery> exampleQueries) { String sqlTemplate = "UPDATE _" + EXAMPLE_QUERIES_TAB + " SET nodes=?, used_ops=CAST(? AS text[]) WHERE example_query=?;"; for (ExampleQuery eQ : exampleQueries) { getJdbcTemplate().update(sqlTemplate, eQ.getNodes(), eQ.g...
java
private void writeAmountOfNodesBack(List<ExampleQuery> exampleQueries) { String sqlTemplate = "UPDATE _" + EXAMPLE_QUERIES_TAB + " SET nodes=?, used_ops=CAST(? AS text[]) WHERE example_query=?;"; for (ExampleQuery eQ : exampleQueries) { getJdbcTemplate().update(sqlTemplate, eQ.getNodes(), eQ.g...
[ "private", "void", "writeAmountOfNodesBack", "(", "List", "<", "ExampleQuery", ">", "exampleQueries", ")", "{", "String", "sqlTemplate", "=", "\"UPDATE _\"", "+", "EXAMPLE_QUERIES_TAB", "+", "\" SET nodes=?, used_ops=CAST(? AS text[]) WHERE example_query=?;\"", ";", "for", ...
Writes the counted nodes and the used operators back to the staging area.
[ "Writes", "the", "counted", "nodes", "and", "the", "used", "operators", "back", "to", "the", "staging", "area", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L2173-L2182
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/AdministrationDao.java
AdministrationDao.checkTopLevelCorpus
private void checkTopLevelCorpus() throws ConflictingCorpusException { String corpusName = getTopLevelCorpusFromTmpArea(); if (existConflictingTopLevelCorpus(corpusName)) { String msg = "There already exists a top level corpus with the name: " + corpusName; throw new ConflictingCorpusE...
java
private void checkTopLevelCorpus() throws ConflictingCorpusException { String corpusName = getTopLevelCorpusFromTmpArea(); if (existConflictingTopLevelCorpus(corpusName)) { String msg = "There already exists a top level corpus with the name: " + corpusName; throw new ConflictingCorpusE...
[ "private", "void", "checkTopLevelCorpus", "(", ")", "throws", "ConflictingCorpusException", "{", "String", "corpusName", "=", "getTopLevelCorpusFromTmpArea", "(", ")", ";", "if", "(", "existConflictingTopLevelCorpus", "(", "corpusName", ")", ")", "{", "String", "msg",...
Checks, if a already exists a corpus with the same name of the top level corpus in the corpus.tab file. If this is the case an Exception is thrown and the import is aborted. @throws annis.administration.DefaultAdministrationDao.ConflictingCorpusException
[ "Checks", "if", "a", "already", "exists", "a", "corpus", "with", "the", "same", "name", "of", "the", "top", "level", "corpus", "in", "the", "corpus", ".", "tab", "file", ".", "If", "this", "is", "the", "case", "an", "Exception", "is", "thrown", "and", ...
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AdministrationDao.java#L2256-L2265
train
korpling/ANNIS
annis-service/src/main/java/annis/AnnisRunner.java
AnnisRunner.doClearExampleQueries
public void doClearExampleQueries(String unused) { for (Long corpusId : corpusList) { System.out.println("delete example queries for " + corpusId); queriesGenerator.delExampleQueries(corpusId); } }
java
public void doClearExampleQueries(String unused) { for (Long corpusId : corpusList) { System.out.println("delete example queries for " + corpusId); queriesGenerator.delExampleQueries(corpusId); } }
[ "public", "void", "doClearExampleQueries", "(", "String", "unused", ")", "{", "for", "(", "Long", "corpusId", ":", "corpusList", ")", "{", "System", ".", "out", ".", "println", "(", "\"delete example queries for \"", "+", "corpusId", ")", ";", "queriesGenerator"...
Clears all example queries.
[ "Clears", "all", "example", "queries", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/AnnisRunner.java#L361-L368
train
korpling/ANNIS
annis-service/src/main/java/annis/AnnisRunner.java
AnnisRunner.doGenerateExampleQueries
public void doGenerateExampleQueries(String args) { Boolean del = false; if (args != null && "overwrite".equals(args)) { del = true; } if (corpusList != null) { for (Long corpusId : corpusList) { System.out.println("generate example queries " + corpusId); que...
java
public void doGenerateExampleQueries(String args) { Boolean del = false; if (args != null && "overwrite".equals(args)) { del = true; } if (corpusList != null) { for (Long corpusId : corpusList) { System.out.println("generate example queries " + corpusId); que...
[ "public", "void", "doGenerateExampleQueries", "(", "String", "args", ")", "{", "Boolean", "del", "=", "false", ";", "if", "(", "args", "!=", "null", "&&", "\"overwrite\"", ".", "equals", "(", "args", ")", ")", "{", "del", "=", "true", ";", "}", "if", ...
Enables the auto generating of example queries for the annis shell. @param args If args is not set the new example queries are added to the old ones. Supported value is <code>overwrite</code>, wich generates new example queries and delete the old ones.
[ "Enables", "the", "auto", "generating", "of", "example", "queries", "for", "the", "annis", "shell", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/AnnisRunner.java#L379-L395
train
korpling/ANNIS
annis-service/src/main/java/annis/AnnisRunner.java
AnnisRunner.analyzeQuery
private QueryData analyzeQuery(String annisQuery, String queryFunction) { QueryData queryData; log.debug("analyze query for " + queryFunction + " function"); if (queryFunction != null && !queryFunction.matches("(sql_)?subgraph")) { queryData = queryDao.parseAQL(annisQuery, corpusList); } ...
java
private QueryData analyzeQuery(String annisQuery, String queryFunction) { QueryData queryData; log.debug("analyze query for " + queryFunction + " function"); if (queryFunction != null && !queryFunction.matches("(sql_)?subgraph")) { queryData = queryDao.parseAQL(annisQuery, corpusList); } ...
[ "private", "QueryData", "analyzeQuery", "(", "String", "annisQuery", ",", "String", "queryFunction", ")", "{", "QueryData", "queryData", ";", "log", ".", "debug", "(", "\"analyze query for \"", "+", "queryFunction", "+", "\" function\"", ")", ";", "if", "(", "qu...
Does the setup for the QueryData object. If the query function is "subgraph" or "sql_subgraph" the annisQuery string should contain space separated salt ids. In this case the annisQuery is not parsed and the {@link QueryData#getAlternatives()} method should return a List with dummy QueryNode entries. Instead of parsin...
[ "Does", "the", "setup", "for", "the", "QueryData", "object", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/AnnisRunner.java#L1034-L1093
train
korpling/ANNIS
annis-service/src/main/java/annis/utils/Utils.java
Utils.calculateSHAHash
public static String calculateSHAHash(String s) throws NoSuchAlgorithmException, UnsupportedEncodingException { MessageDigest md = MessageDigest.getInstance("SHA-256"); md.update(s.getBytes("UTF-8")); byte[] digest = md.digest(); StringBuilder hashVal = new StringBuilder(); for (byte b : dige...
java
public static String calculateSHAHash(String s) throws NoSuchAlgorithmException, UnsupportedEncodingException { MessageDigest md = MessageDigest.getInstance("SHA-256"); md.update(s.getBytes("UTF-8")); byte[] digest = md.digest(); StringBuilder hashVal = new StringBuilder(); for (byte b : dige...
[ "public", "static", "String", "calculateSHAHash", "(", "String", "s", ")", "throws", "NoSuchAlgorithmException", ",", "UnsupportedEncodingException", "{", "MessageDigest", "md", "=", "MessageDigest", ".", "getInstance", "(", "\"SHA-256\"", ")", ";", "md", ".", "upda...
Hashes a string using SHA-256.
[ "Hashes", "a", "string", "using", "SHA", "-", "256", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/utils/Utils.java#L104-L118
train
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/visjs/VisJsComponent.java
VisJsComponent.setHighlightingColor
@Override public String setHighlightingColor(SNode node) { String color = null; SFeature featMatched = node.getFeature(ANNIS_NS, FEAT_MATCHEDNODE); Long matchRaw = featMatched == null ? null : featMatched.getValue_SNUMERIC(); // token is matched if (matchRaw != null) ...
java
@Override public String setHighlightingColor(SNode node) { String color = null; SFeature featMatched = node.getFeature(ANNIS_NS, FEAT_MATCHEDNODE); Long matchRaw = featMatched == null ? null : featMatched.getValue_SNUMERIC(); // token is matched if (matchRaw != null) ...
[ "@", "Override", "public", "String", "setHighlightingColor", "(", "SNode", "node", ")", "{", "String", "color", "=", "null", ";", "SFeature", "featMatched", "=", "node", ".", "getFeature", "(", "ANNIS_NS", ",", "FEAT_MATCHEDNODE", ")", ";", "Long", "matchRaw",...
Implements the getHighlightingColor method of the org.corpus_tools.salt.util.StyleImporter interface.
[ "Implements", "the", "getHighlightingColor", "method", "of", "the", "org", ".", "corpus_tools", ".", "salt", ".", "util", ".", "StyleImporter", "interface", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/visjs/VisJsComponent.java#L460-L475
train
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/AnnisBaseUI.java
AnnisBaseUI.injectUniqueCSS
public void injectUniqueCSS(String cssContent, String wrapperClass) { if(alreadyAddedCSS == null) { alreadyAddedCSS = new TreeSet<String>(); } if(wrapperClass != null) { cssContent = wrapCSS(cssContent, wrapperClass); } String hashForCssContent = Hashing.md5().hashSt...
java
public void injectUniqueCSS(String cssContent, String wrapperClass) { if(alreadyAddedCSS == null) { alreadyAddedCSS = new TreeSet<String>(); } if(wrapperClass != null) { cssContent = wrapCSS(cssContent, wrapperClass); } String hashForCssContent = Hashing.md5().hashSt...
[ "public", "void", "injectUniqueCSS", "(", "String", "cssContent", ",", "String", "wrapperClass", ")", "{", "if", "(", "alreadyAddedCSS", "==", "null", ")", "{", "alreadyAddedCSS", "=", "new", "TreeSet", "<", "String", ">", "(", ")", ";", "}", "if", "(", ...
Inject CSS into the UI. This function will not add multiple style-elements if the exact CSS string was already added. @param cssContent @param wrapperClass Name of the wrapper class (a CSS class that is applied to a parent element)
[ "Inject", "CSS", "into", "the", "UI", ".", "This", "function", "will", "not", "add", "multiple", "style", "-", "elements", "if", "the", "exact", "CSS", "string", "was", "already", "added", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/AnnisBaseUI.java#L441-L461
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java
QueryServiceImpl.frequency
@GET @Path("search/frequency") @Produces("application/xml") public FrequencyTable frequency( @QueryParam("q") String query, @QueryParam("corpora") String rawCorpusNames, @QueryParam("fields") String rawFields) { requiredParameter(query, "q", "AnnisQL query"); requiredParameter(rawCorpusNames...
java
@GET @Path("search/frequency") @Produces("application/xml") public FrequencyTable frequency( @QueryParam("q") String query, @QueryParam("corpora") String rawCorpusNames, @QueryParam("fields") String rawFields) { requiredParameter(query, "q", "AnnisQL query"); requiredParameter(rawCorpusNames...
[ "@", "GET", "@", "Path", "(", "\"search/frequency\"", ")", "@", "Produces", "(", "\"application/xml\"", ")", "public", "FrequencyTable", "frequency", "(", "@", "QueryParam", "(", "\"q\"", ")", "String", "query", ",", "@", "QueryParam", "(", "\"corpora\"", ")",...
Frequency analysis. @param rawFields Comma seperated list of result vector elements. Each element has the form <node-nr>:<anno-name>. The annotation name can be set to "tok" to indicate that the span should be used instead of an annotation.
[ "Frequency", "analysis", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java#L336-L365
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java
QueryServiceImpl.check
@GET @Produces("text/plain") @Path("check") public String check(@QueryParam("q") String query, @DefaultValue("") @QueryParam("corpora") String rawCorpusNames) { Subject user = SecurityUtils.getSubject(); List<String> corpusNames = splitCorpusNamesFromRaw(rawCorpusNames); for (String c : corpusN...
java
@GET @Produces("text/plain") @Path("check") public String check(@QueryParam("q") String query, @DefaultValue("") @QueryParam("corpora") String rawCorpusNames) { Subject user = SecurityUtils.getSubject(); List<String> corpusNames = splitCorpusNamesFromRaw(rawCorpusNames); for (String c : corpusN...
[ "@", "GET", "@", "Produces", "(", "\"text/plain\"", ")", "@", "Path", "(", "\"check\"", ")", "public", "String", "check", "(", "@", "QueryParam", "(", "\"q\"", ")", "String", "query", ",", "@", "DefaultValue", "(", "\"\"", ")", "@", "QueryParam", "(", ...
Return true if this is a valid query or throw exception when invalid @param query Query to check for validity @param rawCorpusNames @return Either "ok" or an error message.
[ "Return", "true", "if", "this", "is", "a", "valid", "query", "or", "throw", "exception", "when", "invalid" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java#L678-L697
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java
QueryServiceImpl.parseNodes
@GET @Path("parse/nodes") @Produces("application/xml") public Response parseNodes(@QueryParam("q") String query, @DefaultValue("") @QueryParam("corpora") String rawCorpusNames) { Subject user = SecurityUtils.getSubject(); List<String> corpusNames = splitCorpusNamesFromRaw(rawCorpusNames); for (S...
java
@GET @Path("parse/nodes") @Produces("application/xml") public Response parseNodes(@QueryParam("q") String query, @DefaultValue("") @QueryParam("corpora") String rawCorpusNames) { Subject user = SecurityUtils.getSubject(); List<String> corpusNames = splitCorpusNamesFromRaw(rawCorpusNames); for (S...
[ "@", "GET", "@", "Path", "(", "\"parse/nodes\"", ")", "@", "Produces", "(", "\"application/xml\"", ")", "public", "Response", "parseNodes", "(", "@", "QueryParam", "(", "\"q\"", ")", "String", "query", ",", "@", "DefaultValue", "(", "\"\"", ")", "@", "Quer...
Return the list of the query nodes if this is a valid query or throw exception when invalid @param query Query to get the query nodes for @param rawCorpusNames @return
[ "Return", "the", "list", "of", "the", "query", "nodes", "if", "this", "is", "a", "valid", "query", "or", "throw", "exception", "when", "invalid" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java#L707-L737
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java
QueryServiceImpl.getExampleQueries
@GET @Path("corpora/example-queries/") @Produces(MediaType.APPLICATION_XML) public List<ExampleQuery> getExampleQueries( @QueryParam("corpora") String rawCorpusNames) throws WebApplicationException { Subject user = SecurityUtils.getSubject(); try { String[] corpusNames; if (r...
java
@GET @Path("corpora/example-queries/") @Produces(MediaType.APPLICATION_XML) public List<ExampleQuery> getExampleQueries( @QueryParam("corpora") String rawCorpusNames) throws WebApplicationException { Subject user = SecurityUtils.getSubject(); try { String[] corpusNames; if (r...
[ "@", "GET", "@", "Path", "(", "\"corpora/example-queries/\"", ")", "@", "Produces", "(", "MediaType", ".", "APPLICATION_XML", ")", "public", "List", "<", "ExampleQuery", ">", "getExampleQueries", "(", "@", "QueryParam", "(", "\"corpora\"", ")", "String", "rawCor...
Fetches the example queries for a specific corpus. @param rawCorpusNames specifies the corpora the examples are fetched from.
[ "Fetches", "the", "example", "queries", "for", "a", "specific", "corpus", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java#L905-L950
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java
QueryServiceImpl.requiredParameter
private void requiredParameter(String value, String name, String description) throws WebApplicationException { if (value == null) { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST).type( MediaType.TEXT_PLAIN).entity( "missing required parameter ...
java
private void requiredParameter(String value, String name, String description) throws WebApplicationException { if (value == null) { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST).type( MediaType.TEXT_PLAIN).entity( "missing required parameter ...
[ "private", "void", "requiredParameter", "(", "String", "value", ",", "String", "name", ",", "String", "description", ")", "throws", "WebApplicationException", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "new", "WebApplicationException", "(", "Respo...
Throw an exception if the parameter is missing. @param value Value which is checked for null. @param name The short name of parameter. @param description A one line description of the meaing of the parameter.
[ "Throw", "an", "exception", "if", "the", "parameter", "is", "missing", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java#L1000-L1011
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java
QueryServiceImpl.splitCorpusNamesFromRaw
private List<String> splitCorpusNamesFromRaw(String rawCorpusNames) { return new ArrayList<>(Splitter.on(",").omitEmptyStrings().trimResults().splitToList(rawCorpusNames)); }
java
private List<String> splitCorpusNamesFromRaw(String rawCorpusNames) { return new ArrayList<>(Splitter.on(",").omitEmptyStrings().trimResults().splitToList(rawCorpusNames)); }
[ "private", "List", "<", "String", ">", "splitCorpusNamesFromRaw", "(", "String", "rawCorpusNames", ")", "{", "return", "new", "ArrayList", "<>", "(", "Splitter", ".", "on", "(", "\",\"", ")", ".", "omitEmptyStrings", "(", ")", ".", "trimResults", "(", ")", ...
Splits a list of corpus names into a proper java list. @param rawCorpusNames The corpus names separated by ",". @return
[ "Splits", "a", "list", "of", "corpus", "names", "into", "a", "proper", "java", "list", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java#L1051-L1054
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java
QueryServiceImpl.getCorpusConfigIntValues
private int getCorpusConfigIntValues(String context) { int value = Integer.parseInt(defaultCorpusConfig.getConfig().getProperty( context)); if (value < 0) { throw new IllegalStateException("the value must be > 0"); } return value; }
java
private int getCorpusConfigIntValues(String context) { int value = Integer.parseInt(defaultCorpusConfig.getConfig().getProperty( context)); if (value < 0) { throw new IllegalStateException("the value must be > 0"); } return value; }
[ "private", "int", "getCorpusConfigIntValues", "(", "String", "context", ")", "{", "int", "value", "=", "Integer", ".", "parseInt", "(", "defaultCorpusConfig", ".", "getConfig", "(", ")", ".", "getProperty", "(", "context", ")", ")", ";", "if", "(", "value", ...
Extract corpus configurations values with numeric values. @param context Must be a valid key of the corpus configuration section in the annis-service.properties file. @return Parses the String representation of the value to int and returns it.
[ "Extract", "corpus", "configurations", "values", "with", "numeric", "values", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java#L1128-L1139
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java
QueryServiceImpl.getRawText
@GET @Path("rawtext/{top}/{docname}") @Produces(MediaType.APPLICATION_XML) public RawTextWrapper getRawText(@PathParam("top") String top, @PathParam("docname") String docname) { Subject user = SecurityUtils.getSubject(); user.checkPermission("query:raw_text:" + top); RawTextWrapper result = new...
java
@GET @Path("rawtext/{top}/{docname}") @Produces(MediaType.APPLICATION_XML) public RawTextWrapper getRawText(@PathParam("top") String top, @PathParam("docname") String docname) { Subject user = SecurityUtils.getSubject(); user.checkPermission("query:raw_text:" + top); RawTextWrapper result = new...
[ "@", "GET", "@", "Path", "(", "\"rawtext/{top}/{docname}\"", ")", "@", "Produces", "(", "MediaType", ".", "APPLICATION_XML", ")", "public", "RawTextWrapper", "getRawText", "(", "@", "PathParam", "(", "\"top\"", ")", "String", "top", ",", "@", "PathParam", "(",...
Fetches the raw text from the text.tab file. @param top the name of the top level corpus. @param docname the name of the document. @return Can be empty, if the corpus only contains media data or segmentations.
[ "Fetches", "the", "raw", "text", "from", "the", "text", ".", "tab", "file", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java#L1187-L1199
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/MetaDataPanel.java
MetaDataPanel.splitListAnnotations
private Map<Integer, List<Annotation>> splitListAnnotations() { List<Annotation> metadata = Helper.getMetaData(toplevelCorpusName, documentName); Map<Integer, List<Annotation>> hashMetaData = new HashMap<>(); if (metadata != null && !metadata.isEmpty()) { // if called from corpus browse...
java
private Map<Integer, List<Annotation>> splitListAnnotations() { List<Annotation> metadata = Helper.getMetaData(toplevelCorpusName, documentName); Map<Integer, List<Annotation>> hashMetaData = new HashMap<>(); if (metadata != null && !metadata.isEmpty()) { // if called from corpus browse...
[ "private", "Map", "<", "Integer", ",", "List", "<", "Annotation", ">", ">", "splitListAnnotations", "(", ")", "{", "List", "<", "Annotation", ">", "metadata", "=", "Helper", ".", "getMetaData", "(", "toplevelCorpusName", ",", "documentName", ")", ";", "Map",...
Returns empty map if no metadata are available.
[ "Returns", "empty", "map", "if", "no", "metadata", "are", "available", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/MetaDataPanel.java#L203-L240
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/MetaDataPanel.java
MetaDataPanel.addEmptyLabel
private void addEmptyLabel() { if (emptyLabel == null) { emptyLabel = new Label("none"); } if (corpusAnnotationTable != null) { layout.removeComponent(corpusAnnotationTable); } layout.addComponent(emptyLabel); // this has only an effect after adding the component to a pa...
java
private void addEmptyLabel() { if (emptyLabel == null) { emptyLabel = new Label("none"); } if (corpusAnnotationTable != null) { layout.removeComponent(corpusAnnotationTable); } layout.addComponent(emptyLabel); // this has only an effect after adding the component to a pa...
[ "private", "void", "addEmptyLabel", "(", ")", "{", "if", "(", "emptyLabel", "==", "null", ")", "{", "emptyLabel", "=", "new", "Label", "(", "\"none\"", ")", ";", "}", "if", "(", "corpusAnnotationTable", "!=", "null", ")", "{", "layout", ".", "removeCompo...
Places a label in the middle center of the corpus browser panel.
[ "Places", "a", "label", "in", "the", "middle", "center", "of", "the", "corpus", "browser", "panel", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/MetaDataPanel.java#L348-L367
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/docbrowser/DocBrowserTable.java
DocBrowserTable.setDocNames
void setDocNames(List<Annotation> docs) { container = new IndexedContainer(); container.addContainerProperty(PROP_DOC_NAME, String.class, "n/a"); MetaColumns metaCols = generateMetaColumns(); for (MetaDataCol metaDatum : metaCols.visibleColumns) { container. addContainerProperty(m...
java
void setDocNames(List<Annotation> docs) { container = new IndexedContainer(); container.addContainerProperty(PROP_DOC_NAME, String.class, "n/a"); MetaColumns metaCols = generateMetaColumns(); for (MetaDataCol metaDatum : metaCols.visibleColumns) { container. addContainerProperty(m...
[ "void", "setDocNames", "(", "List", "<", "Annotation", ">", "docs", ")", "{", "container", "=", "new", "IndexedContainer", "(", ")", ";", "container", ".", "addContainerProperty", "(", "PROP_DOC_NAME", ",", "String", ".", "class", ",", "\"n/a\"", ")", ";", ...
Updates the table with docnames and generate the additional columns defined by the user. @param docs the list of documents, wrapped in the {@link Annotation} POJO
[ "Updates", "the", "table", "with", "docnames", "and", "generate", "the", "additional", "columns", "defined", "by", "the", "user", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/docbrowser/DocBrowserTable.java#L87-L178
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/docbrowser/DocBrowserTable.java
DocBrowserTable.sortByMetaData
private void sortByMetaData(List<MetaDataCol> sortColumns) { if (sortColumns == null || sortColumns.isEmpty()) { sort(new Object[] { PROP_DOC_NAME }, new boolean[] { true }); return; } Object[] sortByColumns = new Object[sortColumns.size()]; bo...
java
private void sortByMetaData(List<MetaDataCol> sortColumns) { if (sortColumns == null || sortColumns.isEmpty()) { sort(new Object[] { PROP_DOC_NAME }, new boolean[] { true }); return; } Object[] sortByColumns = new Object[sortColumns.size()]; bo...
[ "private", "void", "sortByMetaData", "(", "List", "<", "MetaDataCol", ">", "sortColumns", ")", "{", "if", "(", "sortColumns", "==", "null", "||", "sortColumns", ".", "isEmpty", "(", ")", ")", "{", "sort", "(", "new", "Object", "[", "]", "{", "PROP_DOC_NA...
Sort the table by a given config. The config includes metadata keys and the table is sorted lexicographically by their values. If not config for sorting is determined the document name is used for sorting.
[ "Sort", "the", "table", "by", "a", "given", "config", ".", "The", "config", "includes", "metadata", "keys", "and", "the", "table", "is", "sorted", "lexicographically", "by", "their", "values", ".", "If", "not", "config", "for", "sorting", "is", "determined",...
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/docbrowser/DocBrowserTable.java#L303-L332
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/docbrowser/DocBrowserTable.java
DocBrowserTable.getDocMetaData
private List<Annotation> getDocMetaData(String document) { // lookup up meta data in the cache if (!docMetaDataCache.containsKey(docBrowserPanel.getCorpus())) { // get the metadata for the corpus WebResource res = Helper.getAnnisWebResource(); res = res.path("meta/corpus/").path( ...
java
private List<Annotation> getDocMetaData(String document) { // lookup up meta data in the cache if (!docMetaDataCache.containsKey(docBrowserPanel.getCorpus())) { // get the metadata for the corpus WebResource res = Helper.getAnnisWebResource(); res = res.path("meta/corpus/").path( ...
[ "private", "List", "<", "Annotation", ">", "getDocMetaData", "(", "String", "document", ")", "{", "// lookup up meta data in the cache", "if", "(", "!", "docMetaDataCache", ".", "containsKey", "(", "docBrowserPanel", ".", "getCorpus", "(", ")", ")", ")", "{", "/...
Retrieves date from the cache or from the annis rest service for a specific document. @param document The document the data are fetched for. @return The a list of meta data. Can be empty but never null.
[ "Retrieves", "date", "from", "the", "cache", "or", "from", "the", "annis", "rest", "service", "for", "a", "specific", "document", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/docbrowser/DocBrowserTable.java#L408-L445
train
korpling/ANNIS
annis-widgets/src/main/java/annis/gui/widgets/grid/Row.java
Row.addEvent
public boolean addEvent(GridEvent e) { BitSet eventOccupance = new BitSet(e.getRight()); eventOccupance.set(e.getLeft(), e.getRight()+1, true); if(occupancySet.intersects(eventOccupance)) { return false; } // set all bits to true that are covered by the other event occupancySet.or(ev...
java
public boolean addEvent(GridEvent e) { BitSet eventOccupance = new BitSet(e.getRight()); eventOccupance.set(e.getLeft(), e.getRight()+1, true); if(occupancySet.intersects(eventOccupance)) { return false; } // set all bits to true that are covered by the other event occupancySet.or(ev...
[ "public", "boolean", "addEvent", "(", "GridEvent", "e", ")", "{", "BitSet", "eventOccupance", "=", "new", "BitSet", "(", "e", ".", "getRight", "(", ")", ")", ";", "eventOccupance", ".", "set", "(", "e", ".", "getLeft", "(", ")", ",", "e", ".", "getRi...
Adds an event to this row @param e @return False if could not be added because the event is overlapping an other event in the row.
[ "Adds", "an", "event", "to", "this", "row" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-widgets/src/main/java/annis/gui/widgets/grid/Row.java#L55-L73
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/SearchView.java
SearchView.updateFragment
public void updateFragment(DisplayedResultQuery q) { List<String> args = Helper.citationFragment(q.getQuery(), q.getCorpora(), q.getLeftContext(), q.getRightContext(), q.getSegmentation(), q.getBaseText(), q.getOffset(), q.getLimit(), q.getOrder(), q.getSelectedMatches()); // set our fragme...
java
public void updateFragment(DisplayedResultQuery q) { List<String> args = Helper.citationFragment(q.getQuery(), q.getCorpora(), q.getLeftContext(), q.getRightContext(), q.getSegmentation(), q.getBaseText(), q.getOffset(), q.getLimit(), q.getOrder(), q.getSelectedMatches()); // set our fragme...
[ "public", "void", "updateFragment", "(", "DisplayedResultQuery", "q", ")", "{", "List", "<", "String", ">", "args", "=", "Helper", ".", "citationFragment", "(", "q", ".", "getQuery", "(", ")", ",", "q", ".", "getCorpora", "(", ")", ",", "q", ".", "getL...
Updates the browser address bar with the current query parameters and the query itself. This is for convenient reloading the vaadin app and easy copying citation links. @param q The query where the parameters are extracted from.
[ "Updates", "the", "browser", "address", "bar", "with", "the", "current", "query", "parameters", "and", "the", "query", "itself", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/SearchView.java#L700-L714
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/SearchView.java
SearchView.updateFragementWithSelectedCorpus
public void updateFragementWithSelectedCorpus(Set<String> corpora) { if (corpora != null && !corpora.isEmpty()) { String fragment = "_c=" + Helper.encodeBase64URL(StringUtils. join(corpora, ",")); UI.getCurrent().getPage().setUriFragment(fragment); } else { UI.getCurrent(...
java
public void updateFragementWithSelectedCorpus(Set<String> corpora) { if (corpora != null && !corpora.isEmpty()) { String fragment = "_c=" + Helper.encodeBase64URL(StringUtils. join(corpora, ",")); UI.getCurrent().getPage().setUriFragment(fragment); } else { UI.getCurrent(...
[ "public", "void", "updateFragementWithSelectedCorpus", "(", "Set", "<", "String", ">", "corpora", ")", "{", "if", "(", "corpora", "!=", "null", "&&", "!", "corpora", ".", "isEmpty", "(", ")", ")", "{", "String", "fragment", "=", "\"_c=\"", "+", "Helper", ...
Adds the _c fragement to the URL in the browser adress bar when a corpus is selected. @param corpora A list of corpora, which are add to the fragment.
[ "Adds", "the", "_c", "fragement", "to", "the", "URL", "in", "the", "browser", "adress", "bar", "when", "a", "corpus", "is", "selected", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/SearchView.java#L722-L734
train
korpling/ANNIS
annis-service/src/main/java/annis/sqlgen/ResultSetTypedIterator.java
ResultSetTypedIterator.reset
public void reset() { try { if(rs.getType() == ResultSet.TYPE_FORWARD_ONLY) { throw new UnsupportedOperationException("Can not reset iterator for a ResultSet that is of type \"forward only\""); } hasNext = rs.first(); } catch (SQLException ex) { log.error(null...
java
public void reset() { try { if(rs.getType() == ResultSet.TYPE_FORWARD_ONLY) { throw new UnsupportedOperationException("Can not reset iterator for a ResultSet that is of type \"forward only\""); } hasNext = rs.first(); } catch (SQLException ex) { log.error(null...
[ "public", "void", "reset", "(", ")", "{", "try", "{", "if", "(", "rs", ".", "getType", "(", ")", "==", "ResultSet", ".", "TYPE_FORWARD_ONLY", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "\"Can not reset iterator for a ResultSet that is of type \\...
Returns to the beginning of the iteration.
[ "Returns", "to", "the", "beginning", "of", "the", "iteration", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/sqlgen/ResultSetTypedIterator.java#L83-L97
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/frequency/UserGeneratedFrequencyEntry.java
UserGeneratedFrequencyEntry.toFrequencyTableEntry
public FrequencyTableEntry toFrequencyTableEntry() { FrequencyTableEntry result = new FrequencyTableEntry(); result.setReferencedNode(nr); if (annotation != null && "tok".equals(annotation)) { result.setType(FrequencyTableEntryType.span); } else { result.setType(Frequ...
java
public FrequencyTableEntry toFrequencyTableEntry() { FrequencyTableEntry result = new FrequencyTableEntry(); result.setReferencedNode(nr); if (annotation != null && "tok".equals(annotation)) { result.setType(FrequencyTableEntryType.span); } else { result.setType(Frequ...
[ "public", "FrequencyTableEntry", "toFrequencyTableEntry", "(", ")", "{", "FrequencyTableEntry", "result", "=", "new", "FrequencyTableEntry", "(", ")", ";", "result", ".", "setReferencedNode", "(", "nr", ")", ";", "if", "(", "annotation", "!=", "null", "&&", "\"t...
Converts this object to a proper definition. @return
[ "Converts", "this", "object", "to", "a", "proper", "definition", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/frequency/UserGeneratedFrequencyEntry.java#L67-L84
train
korpling/ANNIS
annis-service/src/main/java/annis/rest/provider/SQLExceptionMapper.java
SQLExceptionMapper.map
public static Response map(SQLException sqlEx) { if (null != sqlEx.getSQLState()) { switch (sqlEx.getSQLState()) { //query_canceled case "57014": return Response.status(504).entity(sqlEx.getMessage()).build(); case "2201B": // regular expression did not ...
java
public static Response map(SQLException sqlEx) { if (null != sqlEx.getSQLState()) { switch (sqlEx.getSQLState()) { //query_canceled case "57014": return Response.status(504).entity(sqlEx.getMessage()).build(); case "2201B": // regular expression did not ...
[ "public", "static", "Response", "map", "(", "SQLException", "sqlEx", ")", "{", "if", "(", "null", "!=", "sqlEx", ".", "getSQLState", "(", ")", ")", "{", "switch", "(", "sqlEx", ".", "getSQLState", "(", ")", ")", "{", "//query_canceled", "case", "\"57014\...
Maps an exception to a response or returns null if it wasn't handled @param sqlEx @return
[ "Maps", "an", "exception", "to", "a", "response", "or", "returns", "null", "if", "it", "wasn", "t", "handled" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/rest/provider/SQLExceptionMapper.java#L42-L62
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/exporter/SaltBasedExporter.java
SaltBasedExporter.convertSaltProject
private void convertSaltProject(SaltProject p, List<String> annoKeys, Map<String, String> args, boolean alignmc, int offset, Map<String, CorpusConfig> corpusConfigs, Writer out, Integer nodeCount) throws IOException, IllegalArgumentException { int recordNumber = offset; if(p != null && p.getCorpusGraphs...
java
private void convertSaltProject(SaltProject p, List<String> annoKeys, Map<String, String> args, boolean alignmc, int offset, Map<String, CorpusConfig> corpusConfigs, Writer out, Integer nodeCount) throws IOException, IllegalArgumentException { int recordNumber = offset; if(p != null && p.getCorpusGraphs...
[ "private", "void", "convertSaltProject", "(", "SaltProject", "p", ",", "List", "<", "String", ">", "annoKeys", ",", "Map", "<", "String", ",", "String", ">", "args", ",", "boolean", "alignmc", ",", "int", "offset", ",", "Map", "<", "String", ",", "Corpus...
invokes the createAdjacencyMatrix method, if nodeCount != null or outputText otherwise
[ "invokes", "the", "createAdjacencyMatrix", "method", "if", "nodeCount", "!", "=", "null", "or", "outputText", "otherwise" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/exporter/SaltBasedExporter.java#L319-L389
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/QueryController.java
QueryController.reportServiceException
public void reportServiceException(UniformInterfaceException ex, boolean showNotification) { QueryPanel qp = searchView.getControlPanel().getQueryPanel(); String caption = null; String description = null; if(!AnnisBaseUI.handleCommonError(ex, "execute query")) { switch (ex.getResponse(...
java
public void reportServiceException(UniformInterfaceException ex, boolean showNotification) { QueryPanel qp = searchView.getControlPanel().getQueryPanel(); String caption = null; String description = null; if(!AnnisBaseUI.handleCommonError(ex, "execute query")) { switch (ex.getResponse(...
[ "public", "void", "reportServiceException", "(", "UniformInterfaceException", "ex", ",", "boolean", "showNotification", ")", "{", "QueryPanel", "qp", "=", "searchView", ".", "getControlPanel", "(", ")", ".", "getQueryPanel", "(", ")", ";", "String", "caption", "="...
Show errors that occured during the execution of a query to the user. @param ex The exception to report in the user interface @param showNotification If true a notification is shown instead of only displaying the error in the status label.
[ "Show", "errors", "that", "occured", "during", "the", "execution", "of", "a", "query", "to", "the", "user", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/QueryController.java#L221-L279
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/QueryController.java
QueryController.setIfNew
private static <T> void setIfNew(Property<T> prop, T newValue) { if(!Objects.equals(prop.getValue(), newValue)) { prop.setValue(newValue); } }
java
private static <T> void setIfNew(Property<T> prop, T newValue) { if(!Objects.equals(prop.getValue(), newValue)) { prop.setValue(newValue); } }
[ "private", "static", "<", "T", ">", "void", "setIfNew", "(", "Property", "<", "T", ">", "prop", ",", "T", "newValue", ")", "{", "if", "(", "!", "Objects", ".", "equals", "(", "prop", ".", "getValue", "(", ")", ",", "newValue", ")", ")", "{", "pro...
Only changes the value of the property if it is not equals to the old one. @param <T> @param prop @param newValue
[ "Only", "changes", "the", "value", "of", "the", "property", "if", "it", "is", "not", "equals", "to", "the", "old", "one", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/QueryController.java#L287-L293
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/QueryController.java
QueryController.getExportQuery
public ExportQuery getExportQuery() { return QueryGenerator.export() .query(state.getAql().getValue()) .corpora(state.getSelectedCorpora().getValue()) .left(state.getLeftContext().getValue()) .right(state.getRightContext().getValue()) .segmentation(state.getVisibleBaseText().getValue...
java
public ExportQuery getExportQuery() { return QueryGenerator.export() .query(state.getAql().getValue()) .corpora(state.getSelectedCorpora().getValue()) .left(state.getLeftContext().getValue()) .right(state.getRightContext().getValue()) .segmentation(state.getVisibleBaseText().getValue...
[ "public", "ExportQuery", "getExportQuery", "(", ")", "{", "return", "QueryGenerator", ".", "export", "(", ")", ".", "query", "(", "state", ".", "getAql", "(", ")", ".", "getValue", "(", ")", ")", ".", "corpora", "(", "state", ".", "getSelectedCorpora", "...
Get the current query as it is defined by the UI controls. @return
[ "Get", "the", "current", "query", "as", "it", "is", "defined", "by", "the", "UI", "controls", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/QueryController.java#L355-L368
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/QueryController.java
QueryController.cancelSearch
private void cancelSearch() { // don't spin forever when canceled searchView.getControlPanel().getQueryPanel().setCountIndicatorEnabled(false); Map<QueryUIState.QueryType, Future<?>> exec = state.getExecutedTasks(); // abort last tasks if running if (exec.containsKey(QueryUIState.QueryType.COUNT)...
java
private void cancelSearch() { // don't spin forever when canceled searchView.getControlPanel().getQueryPanel().setCountIndicatorEnabled(false); Map<QueryUIState.QueryType, Future<?>> exec = state.getExecutedTasks(); // abort last tasks if running if (exec.containsKey(QueryUIState.QueryType.COUNT)...
[ "private", "void", "cancelSearch", "(", ")", "{", "// don't spin forever when canceled", "searchView", ".", "getControlPanel", "(", ")", ".", "getQueryPanel", "(", ")", ".", "setCountIndicatorEnabled", "(", "false", ")", ";", "Map", "<", "QueryUIState", ".", "Quer...
Cancel queries from the client side. Important: This does not magically cancel the query on the server side, so don't use this to implement a "real" query cancelation.
[ "Cancel", "queries", "from", "the", "client", "side", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/QueryController.java#L603-L624
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/QueryController.java
QueryController.addHistoryEntry
public void addHistoryEntry(Query q) { try { Query queryCopy = q.clone(); // remove it first in order to let it appear on the beginning of the list state.getHistory().removeItem(queryCopy); state.getHistory().addItemAt(0, queryCopy); searchView.getControlPanel().getQueryPanel().u...
java
public void addHistoryEntry(Query q) { try { Query queryCopy = q.clone(); // remove it first in order to let it appear on the beginning of the list state.getHistory().removeItem(queryCopy); state.getHistory().addItemAt(0, queryCopy); searchView.getControlPanel().getQueryPanel().u...
[ "public", "void", "addHistoryEntry", "(", "Query", "q", ")", "{", "try", "{", "Query", "queryCopy", "=", "q", ".", "clone", "(", ")", ";", "// remove it first in order to let it appear on the beginning of the list", "state", ".", "getHistory", "(", ")", ".", "remo...
Adds a history entry to the history panel. @param q the entry, which is added. @see HistoryPanel
[ "Adds", "a", "history", "entry", "to", "the", "history", "panel", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/QueryController.java#L633-L647
train
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/iframe/CorefVisualizer.java
CorefVisualizer.setReferent
private void setReferent(SNode n, long index, int value) { if (n instanceof SToken) { SToken tok = (SToken) n; if (!referentOfToken.containsKey(tok.getId())) { HashMap<Long, Integer> newlist = new HashMap<Long, Integer>(); newlist.put(index, value);//globalindex? refe...
java
private void setReferent(SNode n, long index, int value) { if (n instanceof SToken) { SToken tok = (SToken) n; if (!referentOfToken.containsKey(tok.getId())) { HashMap<Long, Integer> newlist = new HashMap<Long, Integer>(); newlist.put(index, value);//globalindex? refe...
[ "private", "void", "setReferent", "(", "SNode", "n", ",", "long", "index", ",", "int", "value", ")", "{", "if", "(", "n", "instanceof", "SToken", ")", "{", "SToken", "tok", "=", "(", "SToken", ")", "n", ";", "if", "(", "!", "referentOfToken", ".", ...
adds a Referent for all Nodes dominated or covered by outgoing Edges of AnnisNode a @param n the Node @param index index of the Referent @param value determines wheather the refered P-Edge is incoming (1) or outgoing (0)
[ "adds", "a", "Referent", "for", "all", "Nodes", "dominated", "or", "covered", "by", "outgoing", "Edges", "of", "AnnisNode", "a" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/iframe/CorefVisualizer.java#L858-L891
train
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/iframe/CorefVisualizer.java
CorefVisualizer.searchTokens
private List<String> searchTokens(SNode n, long cnr) { List<String> result = new LinkedList<String>(); if (n instanceof SToken) { result.add(n.getId()); if (componentOfToken.get(n.getId()) == null) { List<Long> newlist = new LinkedList<Long>(); newlist.add(cnr); c...
java
private List<String> searchTokens(SNode n, long cnr) { List<String> result = new LinkedList<String>(); if (n instanceof SToken) { result.add(n.getId()); if (componentOfToken.get(n.getId()) == null) { List<Long> newlist = new LinkedList<Long>(); newlist.add(cnr); c...
[ "private", "List", "<", "String", ">", "searchTokens", "(", "SNode", "n", ",", "long", "cnr", ")", "{", "List", "<", "String", ">", "result", "=", "new", "LinkedList", "<", "String", ">", "(", ")", ";", "if", "(", "n", "instanceof", "SToken", ")", ...
Collects all Token dominated or covered by all outgoing Edges of AnnisNode a @param n @param cnr ComponentNumber this tokens will be added for @return List of Tokennumbers
[ "Collects", "all", "Token", "dominated", "or", "covered", "by", "all", "outgoing", "Edges", "of", "AnnisNode", "a" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/iframe/CorefVisualizer.java#L899-L942
train
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/iframe/CorefVisualizer.java
CorefVisualizer.getAnnotations
private String getAnnotations(String id, long component) { String result = ""; String incoming = "", outgoing = ""; int nri = 1, nro = 1; if(referentOfToken.get(id) != null) { for (long l : referentOfToken.get(id).keySet()) { if (referentList.get((int) l) != null && referentLi...
java
private String getAnnotations(String id, long component) { String result = ""; String incoming = "", outgoing = ""; int nri = 1, nro = 1; if(referentOfToken.get(id) != null) { for (long l : referentOfToken.get(id).keySet()) { if (referentList.get((int) l) != null && referentLi...
[ "private", "String", "getAnnotations", "(", "String", "id", ",", "long", "component", ")", "{", "String", "result", "=", "\"\"", ";", "String", "incoming", "=", "\"\"", ",", "outgoing", "=", "\"\"", ";", "int", "nri", "=", "1", ",", "nro", "=", "1", ...
Collects fitting annotations of an Token @param id id of the given Token @param component componentnumber of the line we need the annotations of @return annotations as a String
[ "Collects", "fitting", "annotations", "of", "an", "Token" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/iframe/CorefVisualizer.java#L950-L1006
train
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/iframe/CorefVisualizer.java
CorefVisualizer.connectionOf
private boolean connectionOf(String pre, String now, long currentComponent) { List<Long> prel = new LinkedList<Long>(), nowl = new LinkedList<Long>(); if (!pre.equals(now) && referentOfToken.get(pre) != null && referentOfToken.get(now) != null) { for (long l : referentOfToken.get(pre).keySet()) ...
java
private boolean connectionOf(String pre, String now, long currentComponent) { List<Long> prel = new LinkedList<Long>(), nowl = new LinkedList<Long>(); if (!pre.equals(now) && referentOfToken.get(pre) != null && referentOfToken.get(now) != null) { for (long l : referentOfToken.get(pre).keySet()) ...
[ "private", "boolean", "connectionOf", "(", "String", "pre", ",", "String", "now", ",", "long", "currentComponent", ")", "{", "List", "<", "Long", ">", "prel", "=", "new", "LinkedList", "<", "Long", ">", "(", ")", ",", "nowl", "=", "new", "LinkedList", ...
Calculates wheather a line determinded by its component should be discontinous @param pre Id of the left token @param now Id of the right token @param currentComponent Number of the component, number of variable "komponent" @return Should the line be continued?
[ "Calculates", "wheather", "a", "line", "determinded", "by", "its", "component", "should", "be", "discontinous" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/iframe/CorefVisualizer.java#L1015-L1073
train
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/iframe/CorefVisualizer.java
CorefVisualizer.getNewColor
private int getNewColor(int i) { int r = (((i) * 224) % 255); int g = (((i + 197) * 1034345) % 255); int b = (((i + 23) * 74353) % 255); // too dark or too bright? if (((r + b + g) / 3) < 100) { r = 255 - r; g = 255 - g; b = 255 - b; } else if (((r + b + g) / 3) > 1...
java
private int getNewColor(int i) { int r = (((i) * 224) % 255); int g = (((i + 197) * 1034345) % 255); int b = (((i + 23) * 74353) % 255); // too dark or too bright? if (((r + b + g) / 3) < 100) { r = 255 - r; g = 255 - g; b = 255 - b; } else if (((r + b + g) / 3) > 1...
[ "private", "int", "getNewColor", "(", "int", "i", ")", "{", "int", "r", "=", "(", "(", "(", "i", ")", "*", "224", ")", "%", "255", ")", ";", "int", "g", "=", "(", "(", "(", "i", "+", "197", ")", "*", "1034345", ")", "%", "255", ")", ";", ...
Returns a unique color-value for a given number @param i identifer of an unique color @return color-value
[ "Returns", "a", "unique", "color", "-", "value", "for", "a", "given", "number" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/iframe/CorefVisualizer.java#L1080-L1108
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/URLShortenerImpl.java
URLShortenerImpl.addNewID
@POST @Produces(value = "text/plain") public String addNewID(String str) { Subject user = SecurityUtils.getSubject(); String remoteIP = request.getRemoteAddr().replaceAll("[.:]", "_"); user.checkPermission("shortener:create:" + remoteIP); return shortenerDao.shorten(str, "" + user.getPri...
java
@POST @Produces(value = "text/plain") public String addNewID(String str) { Subject user = SecurityUtils.getSubject(); String remoteIP = request.getRemoteAddr().replaceAll("[.:]", "_"); user.checkPermission("shortener:create:" + remoteIP); return shortenerDao.shorten(str, "" + user.getPri...
[ "@", "POST", "@", "Produces", "(", "value", "=", "\"text/plain\"", ")", "public", "String", "addNewID", "(", "String", "str", ")", "{", "Subject", "user", "=", "SecurityUtils", ".", "getSubject", "(", ")", ";", "String", "remoteIP", "=", "request", ".", ...
Takes a URI and returns an ID. In order to access this function the {@code shortener:create:<ip> } right is needed. "&lt;ip&gt;" is replaced by the IP of the client which makes this request. Either IPv4 or IPv6 can be used. The dots (IPv4) or colons (IPv6) must be replaced with underscores since they conflict with the...
[ "Takes", "a", "URI", "and", "returns", "an", "ID", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/URLShortenerImpl.java#L74-L84
train
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/visualizers/VisualizerInput.java
VisualizerInput.getMarkedAndCovered
public Map<SNode, Long> getMarkedAndCovered() { if(cachedMarkedAndCoveredNodes == null) { if (document != null) { cachedMarkedAndCoveredNodes = CommonHelper.createSNodeMapFromIDs( markedAndCovered, document.getDocumentGraph()); } } return cachedMarkedAndC...
java
public Map<SNode, Long> getMarkedAndCovered() { if(cachedMarkedAndCoveredNodes == null) { if (document != null) { cachedMarkedAndCoveredNodes = CommonHelper.createSNodeMapFromIDs( markedAndCovered, document.getDocumentGraph()); } } return cachedMarkedAndC...
[ "public", "Map", "<", "SNode", ",", "Long", ">", "getMarkedAndCovered", "(", ")", "{", "if", "(", "cachedMarkedAndCoveredNodes", "==", "null", ")", "{", "if", "(", "document", "!=", "null", ")", "{", "cachedMarkedAndCoveredNodes", "=", "CommonHelper", ".", "...
This map is used for calculating the colors of a matching node. All Nodes, which are not included, should not be colorized. For getting HEX-values according to html or css standards, it is possible to use {@link MatchedNodeColors}. @return
[ "This", "map", "is", "used", "for", "calculating", "the", "colors", "of", "a", "matching", "node", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/visualizers/VisualizerInput.java#L257-L269
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/exporter/TextColumnExporter.java
TextColumnExporter.calculateOrderedMatchNumbersGlobally
private List<Long> calculateOrderedMatchNumbersGlobally(int[][] adjacencyMatrix, boolean matrixIsFilled, Set<Long> singleMatches) { List<Long> orderedMatchNumbers = new ArrayList<Long>(); if (matrixIsFilled) { int first = -1; int second = -1; // iterate over columns and get the pairs of match numbers...
java
private List<Long> calculateOrderedMatchNumbersGlobally(int[][] adjacencyMatrix, boolean matrixIsFilled, Set<Long> singleMatches) { List<Long> orderedMatchNumbers = new ArrayList<Long>(); if (matrixIsFilled) { int first = -1; int second = -1; // iterate over columns and get the pairs of match numbers...
[ "private", "List", "<", "Long", ">", "calculateOrderedMatchNumbersGlobally", "(", "int", "[", "]", "[", "]", "adjacencyMatrix", ",", "boolean", "matrixIsFilled", ",", "Set", "<", "Long", ">", "singleMatches", ")", "{", "List", "<", "Long", ">", "orderedMatchNu...
This method determine a valid order of match numbers and returns them as a list. If the underlying result set is not alignable, it returns an empty list. @param adjacencyMatrix @param matrixIsFilled a boolean, which indicates, whether the adjacency is filled or not @param singleMatches a list of singleton match num...
[ "This", "method", "determine", "a", "valid", "order", "of", "match", "numbers", "and", "returns", "them", "as", "a", "list", ".", "If", "the", "underlying", "result", "set", "is", "not", "alignable", "it", "returns", "an", "empty", "list", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/exporter/TextColumnExporter.java#L768-L855
train
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/Background.java
Background.runWithCallback
public static <T> void runWithCallback(Callable<T> job, final FutureCallback<T> callback) { final UI ui = UI.getCurrent(); ListeningExecutorService exec = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()); ListenableFuture<T> future = exec.submit(job); if(callback != null) ...
java
public static <T> void runWithCallback(Callable<T> job, final FutureCallback<T> callback) { final UI ui = UI.getCurrent(); ListeningExecutorService exec = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()); ListenableFuture<T> future = exec.submit(job); if(callback != null) ...
[ "public", "static", "<", "T", ">", "void", "runWithCallback", "(", "Callable", "<", "T", ">", "job", ",", "final", "FutureCallback", "<", "T", ">", "callback", ")", "{", "final", "UI", "ui", "=", "UI", ".", "getCurrent", "(", ")", ";", "ListeningExecut...
Execute the job in the background and provide a callback which is called when the job is finished. It is guarantied that the callback is executed inside of the UI thread. @param <T> @param job @param callback
[ "Execute", "the", "job", "in", "the", "background", "and", "provide", "a", "callback", "which", "is", "called", "when", "the", "job", "is", "finished", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Background.java#L54-L94
train
korpling/ANNIS
annis-service/src/main/java/annis/dao/autogenqueries/QueriesGenerator.java
QueriesGenerator.delExampleQueries
public void delExampleQueries(List<String> corpusNames) { if (corpusNames == null || corpusNames.isEmpty()) { log.info("delete all example queries"); jdbcTemplate.execute("TRUNCATE example_queries"); } else { List<Long> ids = queryDao.mapCorpusNamesToIds(corpusNames); for ...
java
public void delExampleQueries(List<String> corpusNames) { if (corpusNames == null || corpusNames.isEmpty()) { log.info("delete all example queries"); jdbcTemplate.execute("TRUNCATE example_queries"); } else { List<Long> ids = queryDao.mapCorpusNamesToIds(corpusNames); for ...
[ "public", "void", "delExampleQueries", "(", "List", "<", "String", ">", "corpusNames", ")", "{", "if", "(", "corpusNames", "==", "null", "||", "corpusNames", ".", "isEmpty", "(", ")", ")", "{", "log", ".", "info", "(", "\"delete all example queries\"", ")", ...
Deletes all example queries for a given corpus list. @param corpusNames Determines the example queries to delete. If null the example_querie tab is truncated.
[ "Deletes", "all", "example", "queries", "for", "a", "given", "corpus", "list", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/dao/autogenqueries/QueriesGenerator.java#L137-L153
train
korpling/ANNIS
annis-service/src/main/java/annis/dao/autogenqueries/QueriesGenerator.java
QueriesGenerator.generateQueries
public void generateQueries(Boolean overwrite) { List<AnnisCorpus> corpora = queryDao.listCorpora(); for (AnnisCorpus annisCorpus : corpora) { generateQueries(annisCorpus.getId(), overwrite); } }
java
public void generateQueries(Boolean overwrite) { List<AnnisCorpus> corpora = queryDao.listCorpora(); for (AnnisCorpus annisCorpus : corpora) { generateQueries(annisCorpus.getId(), overwrite); } }
[ "public", "void", "generateQueries", "(", "Boolean", "overwrite", ")", "{", "List", "<", "AnnisCorpus", ">", "corpora", "=", "queryDao", ".", "listCorpora", "(", ")", ";", "for", "(", "AnnisCorpus", "annisCorpus", ":", "corpora", ")", "{", "generateQueries", ...
Generates example queries for all imported corpora. @param overwrite Deletes already exisiting example queries.
[ "Generates", "example", "queries", "for", "all", "imported", "corpora", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/dao/autogenqueries/QueriesGenerator.java#L227-L234
train
korpling/ANNIS
annis-service/src/main/java/annis/sqlgen/FindSqlGenerator.java
FindSqlGenerator.buildSaltId
private URI buildSaltId(List<String> path, String saltID) { StringBuilder sb = new StringBuilder("salt:/"); Iterator<String> itPath = path.iterator(); while(itPath.hasNext()) { String dir = itPath.next(); sb.append(pathEscaper.escape(dir)); if(itPath.hasNext()) { sb.ap...
java
private URI buildSaltId(List<String> path, String saltID) { StringBuilder sb = new StringBuilder("salt:/"); Iterator<String> itPath = path.iterator(); while(itPath.hasNext()) { String dir = itPath.next(); sb.append(pathEscaper.escape(dir)); if(itPath.hasNext()) { sb.ap...
[ "private", "URI", "buildSaltId", "(", "List", "<", "String", ">", "path", ",", "String", "saltID", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "\"salt:/\"", ")", ";", "Iterator", "<", "String", ">", "itPath", "=", "path", ".", "ite...
Builds a proper salt ID. @param path @param saltID @return
[ "Builds", "a", "proper", "salt", "ID", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/sqlgen/FindSqlGenerator.java#L283-L313
train
korpling/ANNIS
annis-interfaces/src/main/java/annis/VersionInfo.java
VersionInfo.getVersion
public static String getVersion() { String rev = getBuildRevision(); Date date = getBuildDate(); StringBuilder result = new StringBuilder(); result.append(getReleaseName()); if (!"".equals(rev) || date != null) { result.append(" ("); boolean added = false; if (!"".equals(re...
java
public static String getVersion() { String rev = getBuildRevision(); Date date = getBuildDate(); StringBuilder result = new StringBuilder(); result.append(getReleaseName()); if (!"".equals(rev) || date != null) { result.append(" ("); boolean added = false; if (!"".equals(re...
[ "public", "static", "String", "getVersion", "(", ")", "{", "String", "rev", "=", "getBuildRevision", "(", ")", ";", "Date", "date", "=", "getBuildDate", "(", ")", ";", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "result", ".", ...
Get a humand readable summary of the version of this build. @return
[ "Get", "a", "humand", "readable", "summary", "of", "the", "version", "of", "this", "build", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/VersionInfo.java#L58-L88
train
korpling/ANNIS
annis-interfaces/src/main/java/annis/VersionInfo.java
VersionInfo.getBuildDate
public static Date getBuildDate() { Date result = null; try { DateFormat format = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss"); String raw = versionProperties.getProperty("build_date"); if(raw != null) { result = format.parse(raw); } } catch (ParseException ex)...
java
public static Date getBuildDate() { Date result = null; try { DateFormat format = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss"); String raw = versionProperties.getProperty("build_date"); if(raw != null) { result = format.parse(raw); } } catch (ParseException ex)...
[ "public", "static", "Date", "getBuildDate", "(", ")", "{", "Date", "result", "=", "null", ";", "try", "{", "DateFormat", "format", "=", "new", "SimpleDateFormat", "(", "\"yyyy-MM-dd_HH-mm-ss\"", ")", ";", "String", "raw", "=", "versionProperties", ".", "getPro...
Get the date when ANNIS was built. @return Either the date or {@code null} if unknown.
[ "Get", "the", "date", "when", "ANNIS", "was", "built", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/VersionInfo.java#L115-L132
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java
SearchOptionsPanel.mergeConfigValue
private String mergeConfigValue(String key, Set<String> corpora, CorpusConfigMap corpusConfigurations) { Set<String> values = new TreeSet<>(); for(String corpus : corpora) { CorpusConfig config = corpusConfigurations.get(corpus); if(config != null) { String v = config.getConf...
java
private String mergeConfigValue(String key, Set<String> corpora, CorpusConfigMap corpusConfigurations) { Set<String> values = new TreeSet<>(); for(String corpus : corpora) { CorpusConfig config = corpusConfigurations.get(corpus); if(config != null) { String v = config.getConf...
[ "private", "String", "mergeConfigValue", "(", "String", "key", ",", "Set", "<", "String", ">", "corpora", ",", "CorpusConfigMap", "corpusConfigurations", ")", "{", "Set", "<", "String", ">", "values", "=", "new", "TreeSet", "<>", "(", ")", ";", "for", "(",...
If all values of a specific corpus property have the same value, this value is returned, otherwise the value of the default configuration is choosen. @param key The property key. @param corpora Specifies the selected corpora. @return A value defined in the copurs.properties file or in the admin-service.properties
[ "If", "all", "values", "of", "a", "specific", "corpus", "property", "have", "the", "same", "value", "this", "value", "is", "returned", "otherwise", "the", "value", "of", "the", "default", "configuration", "is", "choosen", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java#L347-L380
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java
SearchOptionsPanel.mergeConfigs
private CorpusConfig mergeConfigs(Set<String> corpora, CorpusConfigMap corpusConfigurations) { CorpusConfig corpusConfig = new CorpusConfig(); // calculate the left and right context. String leftCtx = mergeConfigValue(KEY_MAX_CONTEXT_LEFT, corpora, corpusConfigurations); String rightCtx = ...
java
private CorpusConfig mergeConfigs(Set<String> corpora, CorpusConfigMap corpusConfigurations) { CorpusConfig corpusConfig = new CorpusConfig(); // calculate the left and right context. String leftCtx = mergeConfigValue(KEY_MAX_CONTEXT_LEFT, corpora, corpusConfigurations); String rightCtx = ...
[ "private", "CorpusConfig", "mergeConfigs", "(", "Set", "<", "String", ">", "corpora", ",", "CorpusConfigMap", "corpusConfigurations", ")", "{", "CorpusConfig", "corpusConfig", "=", "new", "CorpusConfig", "(", ")", ";", "// calculate the left and right context.", "String...
Builds a single config for selection of one or muliple corpora. @param corpora Specifies the combination of corpora, for which the config is calculated. @param corpusConfigurations A map containg the known corpus configurations. @return A new config which takes into account the segementation of all selected corpora.
[ "Builds", "a", "single", "config", "for", "selection", "of", "one", "or", "muliple", "corpora", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java#L391-L421
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java
SearchOptionsPanel.checkSegments
private String checkSegments(String key, Set<String> corpora, CorpusConfigMap corpusConfigurations) { String segmentation = null; for (String corpus : corpora) { CorpusConfig c = null; if (corpusConfigurations.containsConfig(corpus)) { c = corpusConfigurations.get(corpus); ...
java
private String checkSegments(String key, Set<String> corpora, CorpusConfigMap corpusConfigurations) { String segmentation = null; for (String corpus : corpora) { CorpusConfig c = null; if (corpusConfigurations.containsConfig(corpus)) { c = corpusConfigurations.get(corpus); ...
[ "private", "String", "checkSegments", "(", "String", "key", ",", "Set", "<", "String", ">", "corpora", ",", "CorpusConfigMap", "corpusConfigurations", ")", "{", "String", "segmentation", "=", "null", ";", "for", "(", "String", "corpus", ":", "corpora", ")", ...
Checks, if all selected corpora have the same default segmentation layer. If not the tok layer is taken, because every corpus has this one. @param key the key for the segementation config, must be {@link #KEY_DEFAULT_BASE_TEXT_SEGMENTATION} or {@link #KEY_DEFAULT_CONTEXT_SEGMENTATION}. @param corpora the corpora which...
[ "Checks", "if", "all", "selected", "corpora", "have", "the", "same", "default", "segmentation", "layer", ".", "If", "not", "the", "tok", "layer", "is", "taken", "because", "every", "corpus", "has", "this", "one", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java#L433-L486
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java
SearchOptionsPanel.updateContext
private void updateContext(Container c ,int maxCtx, int ctxSteps, boolean keepCustomValues) { if(!keepCustomValues) { c.removeAllItems(); } for (Integer i : PREDEFINED_CONTEXTS) { if (i < maxCtx) { c.addItem(i); } } for (int step = ctxSteps; step < ma...
java
private void updateContext(Container c ,int maxCtx, int ctxSteps, boolean keepCustomValues) { if(!keepCustomValues) { c.removeAllItems(); } for (Integer i : PREDEFINED_CONTEXTS) { if (i < maxCtx) { c.addItem(i); } } for (int step = ctxSteps; step < ma...
[ "private", "void", "updateContext", "(", "Container", "c", ",", "int", "maxCtx", ",", "int", "ctxSteps", ",", "boolean", "keepCustomValues", ")", "{", "if", "(", "!", "keepCustomValues", ")", "{", "c", ".", "removeAllItems", "(", ")", ";", "}", "for", "(...
Updates context combo boxes. @param c the container, which is updated. @param maxCtx the larges context values until context steps are calculated. @param ctxSteps the step range. @param keepCustomValues If this is true all custom values are kept.
[ "Updates", "context", "combo", "boxes", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/controlpanel/SearchOptionsPanel.java#L497-L520
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/AdminServiceImpl.java
AdminServiceImpl.getUserConfig
@GET @Path("userconfig") @Produces("application/xml") public UserConfig getUserConfig() { Subject user = SecurityUtils.getSubject(); user.checkPermission("admin:read:userconfig"); return adminDao.retrieveUserConfig((String) user.getPrincipal()); }
java
@GET @Path("userconfig") @Produces("application/xml") public UserConfig getUserConfig() { Subject user = SecurityUtils.getSubject(); user.checkPermission("admin:read:userconfig"); return adminDao.retrieveUserConfig((String) user.getPrincipal()); }
[ "@", "GET", "@", "Path", "(", "\"userconfig\"", ")", "@", "Produces", "(", "\"application/xml\"", ")", "public", "UserConfig", "getUserConfig", "(", ")", "{", "Subject", "user", "=", "SecurityUtils", ".", "getSubject", "(", ")", ";", "user", ".", "checkPermi...
Get the user configuration for the currently logged in user. @return
[ "Get", "the", "user", "configuration", "for", "the", "currently", "logged", "in", "user", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/AdminServiceImpl.java#L126-L135
train
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/AdminServiceImpl.java
AdminServiceImpl.setUserConfig
@POST @Path("userconfig") @Consumes("application/xml") public Response setUserConfig(JAXBElement<UserConfig> config) { Subject user = SecurityUtils.getSubject(); user.checkPermission("admin:write:userconfig"); String userName = (String) user.getPrincipal(); adminDao.storeUserConfig(userNam...
java
@POST @Path("userconfig") @Consumes("application/xml") public Response setUserConfig(JAXBElement<UserConfig> config) { Subject user = SecurityUtils.getSubject(); user.checkPermission("admin:write:userconfig"); String userName = (String) user.getPrincipal(); adminDao.storeUserConfig(userNam...
[ "@", "POST", "@", "Path", "(", "\"userconfig\"", ")", "@", "Consumes", "(", "\"application/xml\"", ")", "public", "Response", "setUserConfig", "(", "JAXBElement", "<", "UserConfig", ">", "config", ")", "{", "Subject", "user", "=", "SecurityUtils", ".", "getSub...
Sets the user configuration for the currently logged in user.
[ "Sets", "the", "user", "configuration", "for", "the", "currently", "logged", "in", "user", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/AdminServiceImpl.java#L140-L152
train
korpling/ANNIS
annis-interfaces/src/main/java/annis/service/objects/CorpusConfig.java
CorpusConfig.setConfig
public void setConfig(String configName, String configValue) { if (config == null) { config = new Properties(); } if(configValue == null) { config.remove(configName); } else { config.setProperty(configName, configValue); } }
java
public void setConfig(String configName, String configValue) { if (config == null) { config = new Properties(); } if(configValue == null) { config.remove(configName); } else { config.setProperty(configName, configValue); } }
[ "public", "void", "setConfig", "(", "String", "configName", ",", "String", "configValue", ")", "{", "if", "(", "config", "==", "null", ")", "{", "config", "=", "new", "Properties", "(", ")", ";", "}", "if", "(", "configValue", "==", "null", ")", "{", ...
Add a new configuration. If the config name already exists, the config value is overwritten. @param configName The key of the config. @param configValue The value of the new config.
[ "Add", "a", "new", "configuration", ".", "If", "the", "config", "name", "already", "exists", "the", "config", "value", "is", "overwritten", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/service/objects/CorpusConfig.java#L62-L77
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/requesthandler/ContentRange.java
ContentRange.parseFromHeader
public static List<ContentRange> parseFromHeader(String rawRange, long totalSize, int maxNum) throws InvalidRangeException { List<ContentRange> result = new ArrayList<>(); if (rawRange != null) { if(!fullPattern.matcher(rawRange).matches()) { throw new InvalidRangeException("i...
java
public static List<ContentRange> parseFromHeader(String rawRange, long totalSize, int maxNum) throws InvalidRangeException { List<ContentRange> result = new ArrayList<>(); if (rawRange != null) { if(!fullPattern.matcher(rawRange).matches()) { throw new InvalidRangeException("i...
[ "public", "static", "List", "<", "ContentRange", ">", "parseFromHeader", "(", "String", "rawRange", ",", "long", "totalSize", ",", "int", "maxNum", ")", "throws", "InvalidRangeException", "{", "List", "<", "ContentRange", ">", "result", "=", "new", "ArrayList", ...
Parses the header value of a HTTP Range request @param rawRange raw range value as given by the header @param totalSize total size of the content @param maxNum maximal number of allowed ranges. Will throw exception if client requests more ranges. @return @throws annis.gui.requesthandler.ContentRange.InvalidRangeExcepti...
[ "Parses", "the", "header", "value", "of", "a", "HTTP", "Range", "request" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/requesthandler/ContentRange.java#L58-L112
train
korpling/ANNIS
annis-service/src/main/java/annis/sqlgen/CommonAnnotateWithClauseGenerator.java
CommonAnnotateWithClauseGenerator.getMatchesWithClause
protected List<String> getMatchesWithClause(QueryData queryData, List<QueryNode> alternative, String indent) { String indent2= indent + TABSTOP; String indent3 = indent2 + TABSTOP; StringBuilder sbRaw = new StringBuilder(); sbRaw.append(indent).append("matchesRaw AS\n"); sbRaw.append(indent)...
java
protected List<String> getMatchesWithClause(QueryData queryData, List<QueryNode> alternative, String indent) { String indent2= indent + TABSTOP; String indent3 = indent2 + TABSTOP; StringBuilder sbRaw = new StringBuilder(); sbRaw.append(indent).append("matchesRaw AS\n"); sbRaw.append(indent)...
[ "protected", "List", "<", "String", ">", "getMatchesWithClause", "(", "QueryData", "queryData", ",", "List", "<", "QueryNode", ">", "alternative", ",", "String", "indent", ")", "{", "String", "indent2", "=", "indent", "+", "TABSTOP", ";", "String", "indent3", ...
Uses the inner SQL generator and provides an ordered and limited view on the matches with a match number. @param queryData @param alternative @param indent @return
[ "Uses", "the", "inner", "SQL", "generator", "and", "provides", "an", "ordered", "and", "limited", "view", "on", "the", "matches", "with", "a", "match", "number", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/sqlgen/CommonAnnotateWithClauseGenerator.java#L111-L147
train
korpling/ANNIS
annis-service/src/main/java/annis/sqlgen/CommonAnnotateWithClauseGenerator.java
CommonAnnotateWithClauseGenerator.getSolutionFromMatchesWithClause
protected String getSolutionFromMatchesWithClause( IslandsPolicy.IslandPolicies islandPolicy, String matchesName, String indent) { String indent2 = indent + TABSTOP; StringBuilder sb = new StringBuilder(); sb.append(indent).append("solutions AS\n"); sb.append(indent).append("(\n"...
java
protected String getSolutionFromMatchesWithClause( IslandsPolicy.IslandPolicies islandPolicy, String matchesName, String indent) { String indent2 = indent + TABSTOP; StringBuilder sb = new StringBuilder(); sb.append(indent).append("solutions AS\n"); sb.append(indent).append("(\n"...
[ "protected", "String", "getSolutionFromMatchesWithClause", "(", "IslandsPolicy", ".", "IslandPolicies", "islandPolicy", ",", "String", "matchesName", ",", "String", "indent", ")", "{", "String", "indent2", "=", "indent", "+", "TABSTOP", ";", "StringBuilder", "sb", "...
Breaks down the matches table, so that each node of each match has it's own row. @param islandPolicy @param islandPolicies @param matchesName @param indent @return
[ "Breaks", "down", "the", "matches", "table", "so", "that", "each", "node", "of", "each", "match", "has", "it", "s", "own", "row", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/sqlgen/CommonAnnotateWithClauseGenerator.java#L168-L224
train
korpling/ANNIS
annis-service/src/main/java/annis/ql/parser/QueryData.java
QueryData.toAQL
public static String toAQL(List<QueryNode> alternative) { List<String> fragments = new LinkedList<>(); for(QueryNode n : alternative) { String frag = n.toAQLNodeFragment(); if(frag != null && !frag.isEmpty()) { fragments.add(frag); } } for(QueryNode n : al...
java
public static String toAQL(List<QueryNode> alternative) { List<String> fragments = new LinkedList<>(); for(QueryNode n : alternative) { String frag = n.toAQLNodeFragment(); if(frag != null && !frag.isEmpty()) { fragments.add(frag); } } for(QueryNode n : al...
[ "public", "static", "String", "toAQL", "(", "List", "<", "QueryNode", ">", "alternative", ")", "{", "List", "<", "String", ">", "fragments", "=", "new", "LinkedList", "<>", "(", ")", ";", "for", "(", "QueryNode", "n", ":", "alternative", ")", "{", "Str...
Outputs this alternative as an equivalent AQL query. @param alternative @return
[ "Outputs", "this", "alternative", "as", "an", "equivalent", "AQL", "query", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/ql/parser/QueryData.java#L120-L143
train
korpling/ANNIS
annis-service/src/main/java/annis/ql/parser/QueryData.java
QueryData.toAQL
public String toAQL() { StringBuilder sb = new StringBuilder(); Iterator<List<QueryNode>> itAlternative = alternatives.iterator(); while (itAlternative.hasNext()) { List<QueryNode> alt = itAlternative.next(); if (alternatives.size() > 1) { sb.append("("); } sb...
java
public String toAQL() { StringBuilder sb = new StringBuilder(); Iterator<List<QueryNode>> itAlternative = alternatives.iterator(); while (itAlternative.hasNext()) { List<QueryNode> alt = itAlternative.next(); if (alternatives.size() > 1) { sb.append("("); } sb...
[ "public", "String", "toAQL", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "Iterator", "<", "List", "<", "QueryNode", ">", ">", "itAlternative", "=", "alternatives", ".", "iterator", "(", ")", ";", "while", "(", "itAlt...
Outputs this normalized query data as an equivalent AQL query. @return
[ "Outputs", "this", "normalized", "query", "data", "as", "an", "equivalent", "AQL", "query", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/ql/parser/QueryData.java#L150-L179
train
korpling/ANNIS
annis-service/src/main/java/annis/security/ANNISUserConfigurationManager.java
ANNISUserConfigurationManager.writeUser
public boolean writeUser(User user) { // save user info to file if (resourcePath != null) { lock.writeLock().lock(); try { File userDir = new File(resourcePath, "users"); if (userDir.isDirectory()) { // get the file which corresponds to the user File userFile = new File(userDir.getAbsoluteP...
java
public boolean writeUser(User user) { // save user info to file if (resourcePath != null) { lock.writeLock().lock(); try { File userDir = new File(resourcePath, "users"); if (userDir.isDirectory()) { // get the file which corresponds to the user File userFile = new File(userDir.getAbsoluteP...
[ "public", "boolean", "writeUser", "(", "User", "user", ")", "{", "// save user info to file", "if", "(", "resourcePath", "!=", "null", ")", "{", "lock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "File", "userDir", "=", "new", ...
Writes the user to the disk @param user @return True if successful.
[ "Writes", "the", "user", "to", "the", "disk" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/security/ANNISUserConfigurationManager.java#L173-L196
train
korpling/ANNIS
annis-service/src/main/java/annis/security/ANNISUserConfigurationManager.java
ANNISUserConfigurationManager.deleteUser
public boolean deleteUser(String userName) { // load user info from file if (resourcePath != null) { lock.writeLock().lock(); try { File userDir = new File(resourcePath, "users"); if (userDir.isDirectory()) { // get the file which corresponds to the user File userFile = new File(userDir.get...
java
public boolean deleteUser(String userName) { // load user info from file if (resourcePath != null) { lock.writeLock().lock(); try { File userDir = new File(resourcePath, "users"); if (userDir.isDirectory()) { // get the file which corresponds to the user File userFile = new File(userDir.get...
[ "public", "boolean", "deleteUser", "(", "String", "userName", ")", "{", "// load user info from file", "if", "(", "resourcePath", "!=", "null", ")", "{", "lock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "File", "userDir", "=", ...
Deletes the user from the disk @param userName @return True if successful.
[ "Deletes", "the", "user", "from", "the", "disk" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/security/ANNISUserConfigurationManager.java#L204-L221
train
korpling/ANNIS
annis-service/src/main/java/annis/security/ANNISUserConfigurationManager.java
ANNISUserConfigurationManager.deleteGroup
public boolean deleteGroup(String groupName) { if (groupsFile != null) { lock.writeLock().lock(); try { reloadGroupsFromFile(); groups.remove(groupName); return writeGroupFile(); } finally { lock.writeLock().unlock(); } } // end if resourcePath not null return false; }
java
public boolean deleteGroup(String groupName) { if (groupsFile != null) { lock.writeLock().lock(); try { reloadGroupsFromFile(); groups.remove(groupName); return writeGroupFile(); } finally { lock.writeLock().unlock(); } } // end if resourcePath not null return false; }
[ "public", "boolean", "deleteGroup", "(", "String", "groupName", ")", "{", "if", "(", "groupsFile", "!=", "null", ")", "{", "lock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "reloadGroupsFromFile", "(", ")", ";", "groups", ".",...
Deletes the group from the disk @param groupName @return True if successful.
[ "Deletes", "the", "group", "from", "the", "disk" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/security/ANNISUserConfigurationManager.java#L229-L241
train
korpling/ANNIS
annis-service/src/main/java/annis/security/ANNISUserConfigurationManager.java
ANNISUserConfigurationManager.getUserFromFile
private User getUserFromFile(File userFile) { if (userFile.isFile() && userFile.canRead()) { try (FileInputStream userFileIO = new FileInputStream(userFile);) { Properties userProps = new Properties(); userProps.load(userFileIO); return new User(userFile.getName(), userProps); } catch (IOException e...
java
private User getUserFromFile(File userFile) { if (userFile.isFile() && userFile.canRead()) { try (FileInputStream userFileIO = new FileInputStream(userFile);) { Properties userProps = new Properties(); userProps.load(userFileIO); return new User(userFile.getName(), userProps); } catch (IOException e...
[ "private", "User", "getUserFromFile", "(", "File", "userFile", ")", "{", "if", "(", "userFile", ".", "isFile", "(", ")", "&&", "userFile", ".", "canRead", "(", ")", ")", "{", "try", "(", "FileInputStream", "userFileIO", "=", "new", "FileInputStream", "(", ...
Internal helper function to parse a user file. It assumes the calling function already has handled the locking. @param userFile @return
[ "Internal", "helper", "function", "to", "parse", "a", "user", "file", ".", "It", "assumes", "the", "calling", "function", "already", "has", "handled", "the", "locking", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/security/ANNISUserConfigurationManager.java#L270-L281
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/DeleteCorpusDao.java
DeleteCorpusDao.checkAndRemoveTopLevelCorpus
@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED) public void checkAndRemoveTopLevelCorpus(String corpusName) { if (existConflictingTopLevelCorpus(corpusName)) { log.info("delete conflicting corpus: {}", corpusName); List<String> c...
java
@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED) public void checkAndRemoveTopLevelCorpus(String corpusName) { if (existConflictingTopLevelCorpus(corpusName)) { log.info("delete conflicting corpus: {}", corpusName); List<String> c...
[ "@", "Transactional", "(", "readOnly", "=", "false", ",", "propagation", "=", "Propagation", ".", "REQUIRES_NEW", ",", "isolation", "=", "Isolation", ".", "READ_COMMITTED", ")", "public", "void", "checkAndRemoveTopLevelCorpus", "(", "String", "corpusName", ")", "{...
Deletes a top level corpus, when it is already exists. @param corpusName
[ "Deletes", "a", "top", "level", "corpus", "when", "it", "is", "already", "exists", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/DeleteCorpusDao.java#L43-L54
train
korpling/ANNIS
annis-interfaces/src/main/java/annis/security/User.java
User.toProperties
public Properties toProperties() { Properties props = new Properties(); if(passwordHash != null) { props.put("password", passwordHash); } if(groups != null && !groups.isEmpty()) { props.put("groups", Joiner.on(',').join(groups)); } if(permissions != null && !permissions.isE...
java
public Properties toProperties() { Properties props = new Properties(); if(passwordHash != null) { props.put("password", passwordHash); } if(groups != null && !groups.isEmpty()) { props.put("groups", Joiner.on(',').join(groups)); } if(permissions != null && !permissions.isE...
[ "public", "Properties", "toProperties", "(", ")", "{", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "if", "(", "passwordHash", "!=", "null", ")", "{", "props", ".", "put", "(", "\"password\"", ",", "passwordHash", ")", ";", "}", "if", ...
Constructs a represention that is equal to the content of an ANNIS user file. @return
[ "Constructs", "a", "represention", "that", "is", "equal", "to", "the", "content", "of", "an", "ANNIS", "user", "file", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/security/User.java#L144-L164
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/docbrowser/DocBrowserController.java
DocBrowserController.createInput
public static VisualizerInput createInput(String corpus, String docName, Visualizer config, boolean isUsingRawText, List<String> nodeAnnoFilter) { VisualizerInput input = new VisualizerInput(); // set mappings and namespaces. some visualizer do not survive without input.setMappings(parseMappings(c...
java
public static VisualizerInput createInput(String corpus, String docName, Visualizer config, boolean isUsingRawText, List<String> nodeAnnoFilter) { VisualizerInput input = new VisualizerInput(); // set mappings and namespaces. some visualizer do not survive without input.setMappings(parseMappings(c...
[ "public", "static", "VisualizerInput", "createInput", "(", "String", "corpus", ",", "String", "docName", ",", "Visualizer", "config", ",", "boolean", "isUsingRawText", ",", "List", "<", "String", ">", "nodeAnnoFilter", ")", "{", "VisualizerInput", "input", "=", ...
Creates the input. It only takes the salt project or the raw text from the text table, never both, since the increase the performance for large texts. @param corpus the name of the toplevel corpus @param docName the name of the document @param config the visualizer configuration @param isUsingRawText indicates, whethe...
[ "Creates", "the", "input", ".", "It", "only", "takes", "the", "salt", "project", "or", "the", "raw", "text", "from", "the", "text", "table", "never", "both", "since", "the", "increase", "the", "performance", "for", "large", "texts", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/docbrowser/DocBrowserController.java#L171-L216
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/exporter/CSVMultiTokExporter.java
CSVMultiTokExporter.getMatchedNodes
private Set<SNode> getMatchedNodes(SDocumentGraph graph) { Set<SNode> matchedNodes = new HashSet<>(); for (SNode node: graph.getNodes()) { if (node.getFeature(AnnisConstants.ANNIS_NS, AnnisConstants.FEAT_MATCHEDNODE) != null) matchedNodes.add(node); } return matchedNodes; }
java
private Set<SNode> getMatchedNodes(SDocumentGraph graph) { Set<SNode> matchedNodes = new HashSet<>(); for (SNode node: graph.getNodes()) { if (node.getFeature(AnnisConstants.ANNIS_NS, AnnisConstants.FEAT_MATCHEDNODE) != null) matchedNodes.add(node); } return matchedNodes; }
[ "private", "Set", "<", "SNode", ">", "getMatchedNodes", "(", "SDocumentGraph", "graph", ")", "{", "Set", "<", "SNode", ">", "matchedNodes", "=", "new", "HashSet", "<>", "(", ")", ";", "for", "(", "SNode", "node", ":", "graph", ".", "getNodes", "(", ")"...
Takes a match and returns the matched nodes. @param graph @throws java.io.IOException
[ "Takes", "a", "match", "and", "returns", "the", "matched", "nodes", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/exporter/CSVMultiTokExporter.java#L91-L101
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/exporter/CSVMultiTokExporter.java
CSVMultiTokExporter.outputText
@Override public void outputText(SDocumentGraph graph, boolean alignmc, int matchNumber, Writer out) throws IOException, IllegalArgumentException { // first match if (matchNumber == 0) { // output header List<String> headerLine = new ArrayList<>(); for(Map.Entry<Integer, TreeSet<S...
java
@Override public void outputText(SDocumentGraph graph, boolean alignmc, int matchNumber, Writer out) throws IOException, IllegalArgumentException { // first match if (matchNumber == 0) { // output header List<String> headerLine = new ArrayList<>(); for(Map.Entry<Integer, TreeSet<S...
[ "@", "Override", "public", "void", "outputText", "(", "SDocumentGraph", "graph", ",", "boolean", "alignmc", ",", "int", "matchNumber", ",", "Writer", "out", ")", "throws", "IOException", ",", "IllegalArgumentException", "{", "// first match", "if", "(", "matchNumb...
Takes a match and outputs a csv-line @param graph @param alignmc @param matchNumber @param out @throws java.io.IOException
[ "Takes", "a", "match", "and", "outputs", "a", "csv", "-", "line" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/exporter/CSVMultiTokExporter.java#L156-L230
train
korpling/ANNIS
annis-service/src/main/java/annis/sqlgen/SaltAnnotateExtractor.java
SaltAnnotateExtractor.handleArtificialDominanceRelation
private boolean handleArtificialDominanceRelation(SDocumentGraph graph, SNode source, SNode target, SRelation rel, SLayer layer, long componentID, long pre) { List<SRelation<SNode,SNode>> mirrorRelations = graph.getRelations(source.getId(), target.getId()); if (mirrorRelations != null && mir...
java
private boolean handleArtificialDominanceRelation(SDocumentGraph graph, SNode source, SNode target, SRelation rel, SLayer layer, long componentID, long pre) { List<SRelation<SNode,SNode>> mirrorRelations = graph.getRelations(source.getId(), target.getId()); if (mirrorRelations != null && mir...
[ "private", "boolean", "handleArtificialDominanceRelation", "(", "SDocumentGraph", "graph", ",", "SNode", "source", ",", "SNode", "target", ",", "SRelation", "rel", ",", "SLayer", "layer", ",", "long", "componentID", ",", "long", "pre", ")", "{", "List", "<", "...
In ANNIS there is a special combined dominance component which has an empty name, but which should not directly be included in the Salt graph. This functions checks if a dominance relation with empty name has a "mirror" relation which is inside the same layer and between the same nodes but has an relation name. If yes...
[ "In", "ANNIS", "there", "is", "a", "special", "combined", "dominance", "component", "which", "has", "an", "empty", "name", "but", "which", "should", "not", "directly", "be", "included", "in", "the", "Salt", "graph", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/sqlgen/SaltAnnotateExtractor.java#L937-L980
train
korpling/ANNIS
annis-service/src/main/java/annis/sqlgen/SaltAnnotateExtractor.java
SaltAnnotateExtractor.findOrAddSLayer
private SLayer findOrAddSLayer(String name, SDocumentGraph graph) { List<SLayer> layerList = graph.getLayerByName(name); SLayer layer = (layerList != null && layerList.size() > 0) ? layerList.get(0) : null; if (layer == null) { layer = SaltFactory.createSLayer(); layer.setName(name);...
java
private SLayer findOrAddSLayer(String name, SDocumentGraph graph) { List<SLayer> layerList = graph.getLayerByName(name); SLayer layer = (layerList != null && layerList.size() > 0) ? layerList.get(0) : null; if (layer == null) { layer = SaltFactory.createSLayer(); layer.setName(name);...
[ "private", "SLayer", "findOrAddSLayer", "(", "String", "name", ",", "SDocumentGraph", "graph", ")", "{", "List", "<", "SLayer", ">", "layerList", "=", "graph", ".", "getLayerByName", "(", "name", ")", ";", "SLayer", "layer", "=", "(", "layerList", "!=", "n...
Retrieves an existing layer by it's name or creates and adds a new one if not existing yet @param name @param graph @return Either the old or the newly created layer
[ "Retrieves", "an", "existing", "layer", "by", "it", "s", "name", "or", "creates", "and", "adds", "a", "new", "one", "if", "not", "existing", "yet" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/sqlgen/SaltAnnotateExtractor.java#L1091-L1103
train
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/PDFPageHelper.java
PDFPageHelper.getPageAnnoForGridEvent
public String getPageAnnoForGridEvent(SSpan span) { int left = getLeftIndexFromSNode(span); int right = getRightIndexFromSNode(span); if (sspans == null) { log.warn("no page annos found"); return null; } // lookup left index int leftIdx = -1; for (Integer i : sspans.keySet()) {...
java
public String getPageAnnoForGridEvent(SSpan span) { int left = getLeftIndexFromSNode(span); int right = getRightIndexFromSNode(span); if (sspans == null) { log.warn("no page annos found"); return null; } // lookup left index int leftIdx = -1; for (Integer i : sspans.keySet()) {...
[ "public", "String", "getPageAnnoForGridEvent", "(", "SSpan", "span", ")", "{", "int", "left", "=", "getLeftIndexFromSNode", "(", "span", ")", ";", "int", "right", "=", "getRightIndexFromSNode", "(", "span", ")", ";", "if", "(", "sspans", "==", "null", ")", ...
Returns a page annotation for a span, if the span is overlapped by a page annotation.
[ "Returns", "a", "page", "annotation", "for", "a", "span", "if", "the", "span", "is", "overlapped", "by", "a", "page", "annotation", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/PDFPageHelper.java#L81-L117
train
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/PDFPageHelper.java
PDFPageHelper.getLeftIndexFromSNode
public int getLeftIndexFromSNode(SSpan s) { RelannisNodeFeature feat = (RelannisNodeFeature) s.getFeature(SaltUtil.createQName(ANNIS_NS, FEAT_RELANNIS_NODE)).getValue(); return (int) feat.getLeftToken(); }
java
public int getLeftIndexFromSNode(SSpan s) { RelannisNodeFeature feat = (RelannisNodeFeature) s.getFeature(SaltUtil.createQName(ANNIS_NS, FEAT_RELANNIS_NODE)).getValue(); return (int) feat.getLeftToken(); }
[ "public", "int", "getLeftIndexFromSNode", "(", "SSpan", "s", ")", "{", "RelannisNodeFeature", "feat", "=", "(", "RelannisNodeFeature", ")", "s", ".", "getFeature", "(", "SaltUtil", ".", "createQName", "(", "ANNIS_NS", ",", "FEAT_RELANNIS_NODE", ")", ")", ".", ...
Get the most left token index of a SSpan.
[ "Get", "the", "most", "left", "token", "index", "of", "a", "SSpan", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/PDFPageHelper.java#L192-L198
train
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/PDFPageHelper.java
PDFPageHelper.getRightIndexFromSNode
public int getRightIndexFromSNode(SSpan s) { RelannisNodeFeature feat = (RelannisNodeFeature) s.getFeature(SaltUtil.createQName(ANNIS_NS, FEAT_RELANNIS_NODE)).getValue_SOBJECT(); return (int) feat.getRightToken(); }
java
public int getRightIndexFromSNode(SSpan s) { RelannisNodeFeature feat = (RelannisNodeFeature) s.getFeature(SaltUtil.createQName(ANNIS_NS, FEAT_RELANNIS_NODE)).getValue_SOBJECT(); return (int) feat.getRightToken(); }
[ "public", "int", "getRightIndexFromSNode", "(", "SSpan", "s", ")", "{", "RelannisNodeFeature", "feat", "=", "(", "RelannisNodeFeature", ")", "s", ".", "getFeature", "(", "SaltUtil", ".", "createQName", "(", "ANNIS_NS", ",", "FEAT_RELANNIS_NODE", ")", ")", ".", ...
Get the most right token index of a SSpan.
[ "Get", "the", "most", "right", "token", "index", "of", "a", "SSpan", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/PDFPageHelper.java#L204-L211
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/ExampleQueriesPanel.java
ExampleQueriesPanel.setUpTable
private void setUpTable() { setSizeFull(); // expand the table table.setSizeFull(); // Allow selecting items from the table. table.setSelectable(false); // Send changes in selection immediately to server. table.setImmediate(true); // set custom style table.addStyleName("example-queries-table"); ...
java
private void setUpTable() { setSizeFull(); // expand the table table.setSizeFull(); // Allow selecting items from the table. table.setSelectable(false); // Send changes in selection immediately to server. table.setImmediate(true); // set custom style table.addStyleName("example-queries-table"); ...
[ "private", "void", "setUpTable", "(", ")", "{", "setSizeFull", "(", ")", ";", "// expand the table", "table", ".", "setSizeFull", "(", ")", ";", "// Allow selecting items from the table.", "table", ".", "setSelectable", "(", "false", ")", ";", "// Send changes in se...
Sets some layout properties.
[ "Sets", "some", "layout", "properties", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/ExampleQueriesPanel.java#L112-L154
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/ExampleQueriesPanel.java
ExampleQueriesPanel.addItems
private void addItems(List<ExampleQuery> examples) { if (examples != null && examples.size() > 0) { egContainer.addAll(examples); showTab(); } else { hideTabSheet(); } }
java
private void addItems(List<ExampleQuery> examples) { if (examples != null && examples.size() > 0) { egContainer.addAll(examples); showTab(); } else { hideTabSheet(); } }
[ "private", "void", "addItems", "(", "List", "<", "ExampleQuery", ">", "examples", ")", "{", "if", "(", "examples", "!=", "null", "&&", "examples", ".", "size", "(", ")", ">", "0", ")", "{", "egContainer", ".", "addAll", "(", "examples", ")", ";", "sh...
Add items if there are any and put the example query tab in the foreground.
[ "Add", "items", "if", "there", "are", "any", "and", "put", "the", "example", "query", "tab", "in", "the", "foreground", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/ExampleQueriesPanel.java#L159-L166
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/ExampleQueriesPanel.java
ExampleQueriesPanel.showTab
private void showTab() { if (parentTab != null) { tab = parentTab.getTab(this); if (tab != null) { // FIXME: this should be added by the constructor or by the panel that adds this // tab // tab.getComponent().addStyleName("example-queries-tab"); tab.setEnabled(true); if (!(parentTab.getSele...
java
private void showTab() { if (parentTab != null) { tab = parentTab.getTab(this); if (tab != null) { // FIXME: this should be added by the constructor or by the panel that adds this // tab // tab.getComponent().addStyleName("example-queries-tab"); tab.setEnabled(true); if (!(parentTab.getSele...
[ "private", "void", "showTab", "(", ")", "{", "if", "(", "parentTab", "!=", "null", ")", "{", "tab", "=", "parentTab", ".", "getTab", "(", "this", ")", ";", "if", "(", "tab", "!=", "null", ")", "{", "// FIXME: this should be added by the constructor or by the...
Shows the tab and put into the foreground, if no query is executed yet.
[ "Shows", "the", "tab", "and", "put", "into", "the", "foreground", "if", "no", "query", "is", "executed", "yet", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/ExampleQueriesPanel.java#L171-L186
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/ExampleQueriesPanel.java
ExampleQueriesPanel.loadExamplesFromRemote
private static List<ExampleQuery> loadExamplesFromRemote(Set<String> corpusNames) { List<ExampleQuery> result = new LinkedList<>(); WebResource service = Helper.getAnnisWebResource(); try { if (corpusNames == null || corpusNames.isEmpty()) { result = service.path("query").path("corpora").path("example-quer...
java
private static List<ExampleQuery> loadExamplesFromRemote(Set<String> corpusNames) { List<ExampleQuery> result = new LinkedList<>(); WebResource service = Helper.getAnnisWebResource(); try { if (corpusNames == null || corpusNames.isEmpty()) { result = service.path("query").path("corpora").path("example-quer...
[ "private", "static", "List", "<", "ExampleQuery", ">", "loadExamplesFromRemote", "(", "Set", "<", "String", ">", "corpusNames", ")", "{", "List", "<", "ExampleQuery", ">", "result", "=", "new", "LinkedList", "<>", "(", ")", ";", "WebResource", "service", "="...
Loads the available example queries for a specific corpus. @param corpusNames Specifies the corpora example queries are fetched for. If it is null or empty all available example queries are fetched.
[ "Loads", "the", "available", "example", "queries", "for", "a", "specific", "corpus", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/ExampleQueriesPanel.java#L220-L240
train
korpling/ANNIS
annis-gui/src/main/java/annis/gui/ExampleQueriesPanel.java
ExampleQueriesPanel.setSelectedCorpusInBackground
public void setSelectedCorpusInBackground(final Set<String> selectedCorpora) { loadingIndicator.setVisible(true); table.setVisible(false); Background.run(new ExampleFetcher(selectedCorpora, UI.getCurrent())); }
java
public void setSelectedCorpusInBackground(final Set<String> selectedCorpora) { loadingIndicator.setVisible(true); table.setVisible(false); Background.run(new ExampleFetcher(selectedCorpora, UI.getCurrent())); }
[ "public", "void", "setSelectedCorpusInBackground", "(", "final", "Set", "<", "String", ">", "selectedCorpora", ")", "{", "loadingIndicator", ".", "setVisible", "(", "true", ")", ";", "table", ".", "setVisible", "(", "false", ")", ";", "Background", ".", "run",...
Sets the selected corpora and causes a reload @param selectedCorpora Specifies the corpora example queries are fetched for. If it is null, all available example queries are fetched.
[ "Sets", "the", "selected", "corpora", "and", "causes", "a", "reload" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/ExampleQueriesPanel.java#L249-L253
train
korpling/ANNIS
annis-service/src/main/java/annis/administration/CorpusAdministration.java
CorpusAdministration.unzipCorpus
private List<File> unzipCorpus(File outDir, ZipFile zip) { List<File> rootDirs = new ArrayList<>(); Enumeration<? extends ZipEntry> zipEnum = zip.entries(); while (zipEnum.hasMoreElements()) { ZipEntry e = zipEnum.nextElement(); File outFile = new File(outDir, e.getName().replaceAll("\\/"...
java
private List<File> unzipCorpus(File outDir, ZipFile zip) { List<File> rootDirs = new ArrayList<>(); Enumeration<? extends ZipEntry> zipEnum = zip.entries(); while (zipEnum.hasMoreElements()) { ZipEntry e = zipEnum.nextElement(); File outFile = new File(outDir, e.getName().replaceAll("\\/"...
[ "private", "List", "<", "File", ">", "unzipCorpus", "(", "File", "outDir", ",", "ZipFile", "zip", ")", "{", "List", "<", "File", ">", "rootDirs", "=", "new", "ArrayList", "<>", "(", ")", ";", "Enumeration", "<", "?", "extends", "ZipEntry", ">", "zipEnu...
Extract the zipped ANNIS corpus files to an output directory. @param outDir The ouput directory. @param zip ZIP-file to extract. @return A list of root directories where the tab-files are located if found, null otherwise.
[ "Extract", "the", "zipped", "ANNIS", "corpus", "files", "to", "an", "output", "directory", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/CorpusAdministration.java#L270-L324
train