id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
99,800
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/util/ClassLoaderUtils.java
ClassLoaderUtils.forName
public static Class forName(String name) throws ClassNotFoundException { // try with caller classloader ClassLoader loader = getClassLoaderContextAt(3); try { return Class.forName(name, true, loader); } catch (ClassNotFoundException e) { // try with context classloader if set & different ClassLoader co...
java
public static Class forName(String name) throws ClassNotFoundException { // try with caller classloader ClassLoader loader = getClassLoaderContextAt(3); try { return Class.forName(name, true, loader); } catch (ClassNotFoundException e) { // try with context classloader if set & different ClassLoader co...
[ "public", "static", "Class", "forName", "(", "String", "name", ")", "throws", "ClassNotFoundException", "{", "// try with caller classloader", "ClassLoader", "loader", "=", "getClassLoaderContextAt", "(", "3", ")", ";", "try", "{", "return", "Class", ".", "forName",...
Loads a specified class. First, the caller's classloader is used to load the class and if it fails the thread's context classloader is used to load the specified class.
[ "Loads", "a", "specified", "class", ".", "First", "the", "caller", "s", "classloader", "is", "used", "to", "load", "the", "class", "and", "if", "it", "fails", "the", "thread", "s", "context", "classloader", "is", "used", "to", "load", "the", "specified", ...
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/ClassLoaderUtils.java#L99-L113
99,801
jglobus/JGlobus
io/src/main/java/org/globus/io/gass/server/RemoteGassServer.java
RemoteGassServer.start
public void start(String rmc) throws GassException { if (rmc == null) { throw new IllegalArgumentException("Resource manager contact not specified"); } GassServer gassServer = null; String error = null; try { gassServer = new GassServer(this.cred, 0); String gassURL = gassServer...
java
public void start(String rmc) throws GassException { if (rmc == null) { throw new IllegalArgumentException("Resource manager contact not specified"); } GassServer gassServer = null; String error = null; try { gassServer = new GassServer(this.cred, 0); String gassURL = gassServer...
[ "public", "void", "start", "(", "String", "rmc", ")", "throws", "GassException", "{", "if", "(", "rmc", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Resource manager contact not specified\"", ")", ";", "}", "GassServer", "gassServer"...
Starts the gass server on the remote machine. @param rmc resource manager contact of the remote machine. @exception GassException if any error occurs during remote startup.
[ "Starts", "the", "gass", "server", "on", "the", "remote", "machine", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/io/src/main/java/org/globus/io/gass/server/RemoteGassServer.java#L148-L234
99,802
jglobus/JGlobus
io/src/main/java/org/globus/io/gass/server/RemoteGassServer.java
RemoteGassServer.shutdown
public boolean shutdown() { if (url != null) { logger.debug("Trying to shutdown gass server directly..."); try { GlobusURL u = new GlobusURL(url); GassServer.shutdown(this.cred, u); } catch(Exception e) { logger.debug("gass server shutdown failed", e); } try { gassJobListener.reset()...
java
public boolean shutdown() { if (url != null) { logger.debug("Trying to shutdown gass server directly..."); try { GlobusURL u = new GlobusURL(url); GassServer.shutdown(this.cred, u); } catch(Exception e) { logger.debug("gass server shutdown failed", e); } try { gassJobListener.reset()...
[ "public", "boolean", "shutdown", "(", ")", "{", "if", "(", "url", "!=", "null", ")", "{", "logger", ".", "debug", "(", "\"Trying to shutdown gass server directly...\"", ")", ";", "try", "{", "GlobusURL", "u", "=", "new", "GlobusURL", "(", "url", ")", ";", ...
Shutdowns remotely running gass server. @return true if server was successfully killed, false otherwise.
[ "Shutdowns", "remotely", "running", "gass", "server", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/io/src/main/java/org/globus/io/gass/server/RemoteGassServer.java#L242-L281
99,803
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/util/Util.java
Util.createFile
public static File createFile(String filename) throws SecurityException, IOException { File f = new File(filename); if (!f.createNewFile()) { if (!destroy(f)) { throw new SecurityException( "Could not destroy existing file"); ...
java
public static File createFile(String filename) throws SecurityException, IOException { File f = new File(filename); if (!f.createNewFile()) { if (!destroy(f)) { throw new SecurityException( "Could not destroy existing file"); ...
[ "public", "static", "File", "createFile", "(", "String", "filename", ")", "throws", "SecurityException", ",", "IOException", "{", "File", "f", "=", "new", "File", "(", "filename", ")", ";", "if", "(", "!", "f", ".", "createNewFile", "(", ")", ")", "{", ...
Attempts to create a new file in an atomic way. If the file already exists, it if first deleted. @param filename the name of file to create. @return the created file. @throws SecurityException if the existing file cannot be deleted. @throws IOException if an I/O error occurred.
[ "Attempts", "to", "create", "a", "new", "file", "in", "an", "atomic", "way", ".", "If", "the", "file", "already", "exists", "it", "if", "first", "deleted", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L45-L60
99,804
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/util/Util.java
Util.destroy
public static boolean destroy(File file) { if (!file.exists()) return false; RandomAccessFile f = null; long size = file.length(); try { f = new RandomAccessFile(file, "rw"); long rec = size/DMSG.length(); int left = (int)(size - rec*DMSG.length()); ...
java
public static boolean destroy(File file) { if (!file.exists()) return false; RandomAccessFile f = null; long size = file.length(); try { f = new RandomAccessFile(file, "rw"); long rec = size/DMSG.length(); int left = (int)(size - rec*DMSG.length()); ...
[ "public", "static", "boolean", "destroy", "(", "File", "file", ")", "{", "if", "(", "!", "file", ".", "exists", "(", ")", ")", "return", "false", ";", "RandomAccessFile", "f", "=", "null", ";", "long", "size", "=", "file", ".", "length", "(", ")", ...
Overwrites the contents of the file with a random string and then deletes the file. @param file file to remove
[ "Overwrites", "the", "contents", "of", "the", "file", "with", "a", "random", "string", "and", "then", "deletes", "the", "file", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L139-L164
99,805
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/util/Util.java
Util.getInput
public static String getInput(String prompt) { System.out.print(prompt); try { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); return in.readLine(); } catch(IOException e) { return null; } }
java
public static String getInput(String prompt) { System.out.print(prompt); try { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); return in.readLine(); } catch(IOException e) { return null; } }
[ "public", "static", "String", "getInput", "(", "String", "prompt", ")", "{", "System", ".", "out", ".", "print", "(", "prompt", ")", ";", "try", "{", "BufferedReader", "in", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "System", ".",...
Displays a prompt and then reads in the input from System.in. @param prompt the prompt to be displayed @return <code>String</code> the input read in (entered after the prompt)
[ "Displays", "a", "prompt", "and", "then", "reads", "in", "the", "input", "from", "System", ".", "in", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L172-L182
99,806
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/util/Util.java
Util.getPrivateInput
public static String getPrivateInput(String prompt) { System.out.print(prompt); PrivateInputThread privateInput = new PrivateInputThread(); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); privateInput.start(); try { return in.re...
java
public static String getPrivateInput(String prompt) { System.out.print(prompt); PrivateInputThread privateInput = new PrivateInputThread(); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); privateInput.start(); try { return in.re...
[ "public", "static", "String", "getPrivateInput", "(", "String", "prompt", ")", "{", "System", ".", "out", ".", "print", "(", "prompt", ")", ";", "PrivateInputThread", "privateInput", "=", "new", "PrivateInputThread", "(", ")", ";", "BufferedReader", "in", "=",...
Displays a prompt and then reads in private input from System.in. Characters typed by the user are replaced with a space on the screen. @param prompt the prompt to be displayed @return <code>String</code> the input read in (entered after the prompt)
[ "Displays", "a", "prompt", "and", "then", "reads", "in", "private", "input", "from", "System", ".", "in", ".", "Characters", "typed", "by", "the", "user", "are", "replaced", "with", "a", "space", "on", "the", "screen", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L191-L206
99,807
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/util/Util.java
Util.quote
public static String quote(String str) { int len = str.length(); StringBuffer buf = new StringBuffer(len+2); buf.append("\""); char c; for (int i=0;i<len;i++) { c = str.charAt(i); if (c == '"' || c == '\\') { buf.append("\\"); }...
java
public static String quote(String str) { int len = str.length(); StringBuffer buf = new StringBuffer(len+2); buf.append("\""); char c; for (int i=0;i<len;i++) { c = str.charAt(i); if (c == '"' || c == '\\') { buf.append("\\"); }...
[ "public", "static", "String", "quote", "(", "String", "str", ")", "{", "int", "len", "=", "str", ".", "length", "(", ")", ";", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", "len", "+", "2", ")", ";", "buf", ".", "append", "(", "\"\\\"\"", ...
Quotifies a specified string. The entire string is encompassed by double quotes and each " is replaced with \", \ is replaced with \\. @param str the string to quotify @return quotified and escaped string
[ "Quotifies", "a", "specified", "string", ".", "The", "entire", "string", "is", "encompassed", "by", "double", "quotes", "and", "each", "is", "replaced", "with", "\\", "\\", "is", "replaced", "with", "\\\\", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L237-L251
99,808
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/util/Util.java
Util.unquote
public static String unquote(String str) throws Exception { int len = str.length(); StringBuffer buf = new StringBuffer(len); boolean inQuotes = false; char c; int i = 0; if (str.charAt(i) == '"') { inQuotes = true; i++; } ...
java
public static String unquote(String str) throws Exception { int len = str.length(); StringBuffer buf = new StringBuffer(len); boolean inQuotes = false; char c; int i = 0; if (str.charAt(i) == '"') { inQuotes = true; i++; } ...
[ "public", "static", "String", "unquote", "(", "String", "str", ")", "throws", "Exception", "{", "int", "len", "=", "str", ".", "length", "(", ")", ";", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", "len", ")", ";", "boolean", "inQuotes", "=", ...
Dequotifies a specified string. The quotes are removed and each \" is replaced with " and each \\ is replaced with \. @param str the string to dequotify. @return unquotified string.
[ "Dequotifies", "a", "specified", "string", ".", "The", "quotes", "are", "removed", "and", "each", "\\", "is", "replaced", "with", "and", "each", "\\\\", "is", "replaced", "with", "\\", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/Util.java#L261-L298
99,809
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java
BouncyCastleCertProcessingFactory.createCredential
public X509Credential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime, GSIConstants.CertificateType certType, X509ExtensionSet extSet, String cnValue) throws GeneralSecurityException { X509Certificate[] bcCerts = getX509CertificateObjectChain(certs); Key...
java
public X509Credential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime, GSIConstants.CertificateType certType, X509ExtensionSet extSet, String cnValue) throws GeneralSecurityException { X509Certificate[] bcCerts = getX509CertificateObjectChain(certs); Key...
[ "public", "X509Credential", "createCredential", "(", "X509Certificate", "[", "]", "certs", ",", "PrivateKey", "privateKey", ",", "int", "bits", ",", "int", "lifetime", ",", "GSIConstants", ".", "CertificateType", "certType", ",", "X509ExtensionSet", "extSet", ",", ...
Creates a new proxy credential from the specified certificate chain and a private key. A set of X.509 extensions can be optionally included in the new proxy certificate. This function automatically creates a "RSA"-based key pair. @see #createProxyCertificate(X509Certificate, PrivateKey, PublicKey, int, int, X509Extens...
[ "Creates", "a", "new", "proxy", "credential", "from", "the", "specified", "certificate", "chain", "and", "a", "private", "key", ".", "A", "set", "of", "X", ".", "509", "extensions", "can", "be", "optionally", "included", "in", "the", "new", "proxy", "certi...
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L645-L663
99,810
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java
BouncyCastleCertProcessingFactory.loadCertificate
public X509Certificate loadCertificate(InputStream in) throws IOException, GeneralSecurityException { ASN1InputStream derin = new ASN1InputStream(in); ASN1Primitive certInfo = derin.readObject(); ASN1Sequence seq = ASN1Sequence.getInstance(certInfo); return new X509CertificateObject(Cert...
java
public X509Certificate loadCertificate(InputStream in) throws IOException, GeneralSecurityException { ASN1InputStream derin = new ASN1InputStream(in); ASN1Primitive certInfo = derin.readObject(); ASN1Sequence seq = ASN1Sequence.getInstance(certInfo); return new X509CertificateObject(Cert...
[ "public", "X509Certificate", "loadCertificate", "(", "InputStream", "in", ")", "throws", "IOException", ",", "GeneralSecurityException", "{", "ASN1InputStream", "derin", "=", "new", "ASN1InputStream", "(", "in", ")", ";", "ASN1Primitive", "certInfo", "=", "derin", "...
Loads a X509 certificate from the specified input stream. Input stream must contain DER-encoded certificate. @param in the input stream to read the certificate from. @return <code>X509Certificate</code> the loaded certificate. @exception GeneralSecurityException if certificate failed to load.
[ "Loads", "a", "X509", "certificate", "from", "the", "specified", "input", "stream", ".", "Input", "stream", "must", "contain", "DER", "-", "encoded", "certificate", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L924-L929
99,811
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java
BouncyCastleCertProcessingFactory.createCertificateRequest
public byte[] createCertificateRequest(X509Name subjectDN, String sigAlgName, KeyPair keyPair) throws GeneralSecurityException { DERSet attrs = null; PKCS10CertificationRequest certReq = null; certReq = new PKCS10CertificationRequest(sigAlgName, subjectDN, keyPair.getPublic(), attrs, key...
java
public byte[] createCertificateRequest(X509Name subjectDN, String sigAlgName, KeyPair keyPair) throws GeneralSecurityException { DERSet attrs = null; PKCS10CertificationRequest certReq = null; certReq = new PKCS10CertificationRequest(sigAlgName, subjectDN, keyPair.getPublic(), attrs, key...
[ "public", "byte", "[", "]", "createCertificateRequest", "(", "X509Name", "subjectDN", ",", "String", "sigAlgName", ",", "KeyPair", "keyPair", ")", "throws", "GeneralSecurityException", "{", "DERSet", "attrs", "=", "null", ";", "PKCS10CertificationRequest", "certReq", ...
Creates a certificate request from the specified subject name, signing algorithm, and a key pair. @param subjectDN the subject name of the certificate request. @param sigAlgName the signing algorithm name. @param keyPair the key pair of the certificate request @return the certificate request. @exception GeneralSecurit...
[ "Creates", "a", "certificate", "request", "from", "the", "specified", "subject", "name", "signing", "algorithm", "and", "a", "key", "pair", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L983-L991
99,812
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java
BouncyCastleCertProcessingFactory.decideProxyType
public static GSIConstants.CertificateType decideProxyType( X509Certificate issuerCert, GSIConstants.DelegationType delegType) throws CertificateException { GSIConstants.CertificateType proxyType = GSIConstants.CertificateType.UNDEFINED; if (delegType == GSIConstants.DelegationTy...
java
public static GSIConstants.CertificateType decideProxyType( X509Certificate issuerCert, GSIConstants.DelegationType delegType) throws CertificateException { GSIConstants.CertificateType proxyType = GSIConstants.CertificateType.UNDEFINED; if (delegType == GSIConstants.DelegationTy...
[ "public", "static", "GSIConstants", ".", "CertificateType", "decideProxyType", "(", "X509Certificate", "issuerCert", ",", "GSIConstants", ".", "DelegationType", "delegType", ")", "throws", "CertificateException", "{", "GSIConstants", ".", "CertificateType", "proxyType", "...
Given a delegation mode and an issuing certificate, decides an appropriate certificate type to use for proxies @param issuerCert the issuing certificate of a prospective proxy @param delegType the desired delegation mode @return the appropriate certificate type for proxies or GSIConstants.CertificateType.UNDEFINED when...
[ "Given", "a", "delegation", "mode", "and", "an", "issuing", "certificate", "decides", "an", "appropriate", "certificate", "type", "to", "use", "for", "proxies" ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L1004-L1046
99,813
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslNode.java
RslNode.getParam
public NameOpValue getParam(String attribute) { if (_relations == null || attribute == null) return null; return (NameOpValue)_relations.get(canonicalize(attribute)); }
java
public NameOpValue getParam(String attribute) { if (_relations == null || attribute == null) return null; return (NameOpValue)_relations.get(canonicalize(attribute)); }
[ "public", "NameOpValue", "getParam", "(", "String", "attribute", ")", "{", "if", "(", "_relations", "==", "null", "||", "attribute", "==", "null", ")", "return", "null", ";", "return", "(", "NameOpValue", ")", "_relations", ".", "get", "(", "canonicalize", ...
Returns the relation associated with the given attribute. @param attribute the attribute of the relation. @return the relation for the attribute. Null, if not found.
[ "Returns", "the", "relation", "associated", "with", "the", "given", "attribute", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslNode.java#L105-L108
99,814
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslNode.java
RslNode.removeBindings
public Bindings removeBindings(String attribute) { if (_relations == null || attribute == null) return null; return (Bindings)_bindings.remove(canonicalize(attribute)); }
java
public Bindings removeBindings(String attribute) { if (_relations == null || attribute == null) return null; return (Bindings)_bindings.remove(canonicalize(attribute)); }
[ "public", "Bindings", "removeBindings", "(", "String", "attribute", ")", "{", "if", "(", "_relations", "==", "null", "||", "attribute", "==", "null", ")", "return", "null", ";", "return", "(", "Bindings", ")", "_bindings", ".", "remove", "(", "canonicalize",...
Removes a bindings list for the specified attribute. @param attribute the attribute name for the bindings. @return the bindings that were removed.
[ "Removes", "a", "bindings", "list", "for", "the", "specified", "attribute", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslNode.java#L142-L145
99,815
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslNode.java
RslNode.toRSL
public void toRSL(StringBuffer buf, boolean explicitConcat) { Iterator iter; buf.append( getOperatorAsString() ); if (_bindings != null && _bindings.size() > 0) { iter = _bindings.keySet().iterator(); Bindings binds; while( iter.hasNext() ) { binds = getBindings( (String)iter.next() ); binds.toR...
java
public void toRSL(StringBuffer buf, boolean explicitConcat) { Iterator iter; buf.append( getOperatorAsString() ); if (_bindings != null && _bindings.size() > 0) { iter = _bindings.keySet().iterator(); Bindings binds; while( iter.hasNext() ) { binds = getBindings( (String)iter.next() ); binds.toR...
[ "public", "void", "toRSL", "(", "StringBuffer", "buf", ",", "boolean", "explicitConcat", ")", "{", "Iterator", "iter", ";", "buf", ".", "append", "(", "getOperatorAsString", "(", ")", ")", ";", "if", "(", "_bindings", "!=", "null", "&&", "_bindings", ".", ...
Produces a RSL representation of node. @param buf buffer to add the RSL representation to. @param explicitConcat if true explicit concatination will be used in RSL strings.
[ "Produces", "a", "RSL", "representation", "of", "node", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslNode.java#L226-L259
99,816
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslAttributes.java
RslAttributes.getSingle
public String getSingle(String attribute) { NameOpValue nv = rslTree.getParam(attribute); if (nv == null || nv.getOperator() != NameOpValue.EQ) return null; Object obj = nv.getFirstValue(); if (obj != null && obj instanceof Value) { return ((Value)obj).getCompleteValue(); } else { return null; } }
java
public String getSingle(String attribute) { NameOpValue nv = rslTree.getParam(attribute); if (nv == null || nv.getOperator() != NameOpValue.EQ) return null; Object obj = nv.getFirstValue(); if (obj != null && obj instanceof Value) { return ((Value)obj).getCompleteValue(); } else { return null; } }
[ "public", "String", "getSingle", "(", "String", "attribute", ")", "{", "NameOpValue", "nv", "=", "rslTree", ".", "getParam", "(", "attribute", ")", ";", "if", "(", "nv", "==", "null", "||", "nv", ".", "getOperator", "(", ")", "!=", "NameOpValue", ".", ...
Returns a string value of the specified attribute. If the attribute contains multiple values the first one is returned. @param attribute the rsl attribute to return the value of. @return value of the relation. Null is returned if there is no such attribute of the attribute/value relation is not an equality relation.
[ "Returns", "a", "string", "value", "of", "the", "specified", "attribute", ".", "If", "the", "attribute", "contains", "multiple", "values", "the", "first", "one", "is", "returned", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L78-L87
99,817
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslAttributes.java
RslAttributes.getMulti
public List getMulti(String attribute) { NameOpValue nv = rslTree.getParam(attribute); if (nv == null || nv.getOperator() != NameOpValue.EQ) return null; List values = nv.getValues(); List list = new LinkedList(); Iterator iter = values.iterator(); Object obj; while( iter.hasNext() ) { obj = iter.next(); ...
java
public List getMulti(String attribute) { NameOpValue nv = rslTree.getParam(attribute); if (nv == null || nv.getOperator() != NameOpValue.EQ) return null; List values = nv.getValues(); List list = new LinkedList(); Iterator iter = values.iterator(); Object obj; while( iter.hasNext() ) { obj = iter.next(); ...
[ "public", "List", "getMulti", "(", "String", "attribute", ")", "{", "NameOpValue", "nv", "=", "rslTree", ".", "getParam", "(", "attribute", ")", ";", "if", "(", "nv", "==", "null", "||", "nv", ".", "getOperator", "(", ")", "!=", "NameOpValue", ".", "EQ...
Returns a list of strings for a specified attribute. For example for 'arguments' attribute. @param attribute the rsl attribute to return the values of. @return the list of values of the relation. Each value is a string. Null is returned if there is no such attribute or the attribute/values relation is not an equality ...
[ "Returns", "a", "list", "of", "strings", "for", "a", "specified", "attribute", ".", "For", "example", "for", "arguments", "attribute", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L99-L113
99,818
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslAttributes.java
RslAttributes.addVariable
public void addVariable(String attribute, String varName, String value) { Bindings binds = rslTree.getBindings(attribute); if (binds == null) { binds = new Bindings(attribute); rslTree.put(binds); } binds.add(new Binding(varName, value)); }
java
public void addVariable(String attribute, String varName, String value) { Bindings binds = rslTree.getBindings(attribute); if (binds == null) { binds = new Bindings(attribute); rslTree.put(binds); } binds.add(new Binding(varName, value)); }
[ "public", "void", "addVariable", "(", "String", "attribute", ",", "String", "varName", ",", "String", "value", ")", "{", "Bindings", "binds", "=", "rslTree", ".", "getBindings", "(", "attribute", ")", ";", "if", "(", "binds", "==", "null", ")", "{", "bin...
Adds a new variable definition to the specified variable definitions attribute. @param attribute the variable definitions attribute - rsl_subsititution. @param varName the variable name to add. @param value the value of the variable to add.
[ "Adds", "a", "new", "variable", "definition", "to", "the", "specified", "variable", "definitions", "attribute", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L189-L196
99,819
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslAttributes.java
RslAttributes.removeVariable
public boolean removeVariable(String attribute, String varName) { Bindings binds = rslTree.getBindings(attribute); if (binds == null) return false; return binds.removeVariable(varName); }
java
public boolean removeVariable(String attribute, String varName) { Bindings binds = rslTree.getBindings(attribute); if (binds == null) return false; return binds.removeVariable(varName); }
[ "public", "boolean", "removeVariable", "(", "String", "attribute", ",", "String", "varName", ")", "{", "Bindings", "binds", "=", "rslTree", ".", "getBindings", "(", "attribute", ")", ";", "if", "(", "binds", "==", "null", ")", "return", "false", ";", "retu...
Removes a specific variable definition given a variable name. @param attribute the attribute that defines variable definitions. @param varName the name of the variable to remove. @return true if the variable was successfully removed. Otherwise, returns false,
[ "Removes", "a", "specific", "variable", "definition", "given", "a", "variable", "name", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L206-L210
99,820
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslAttributes.java
RslAttributes.remove
public boolean remove(String attribute, String value) { NameOpValue nv = rslTree.getParam(attribute); if (nv == null || nv.getOperator() != NameOpValue.EQ) return false; return nv.remove(new Value(value)); }
java
public boolean remove(String attribute, String value) { NameOpValue nv = rslTree.getParam(attribute); if (nv == null || nv.getOperator() != NameOpValue.EQ) return false; return nv.remove(new Value(value)); }
[ "public", "boolean", "remove", "(", "String", "attribute", ",", "String", "value", ")", "{", "NameOpValue", "nv", "=", "rslTree", ".", "getParam", "(", "attribute", ")", ";", "if", "(", "nv", "==", "null", "||", "nv", ".", "getOperator", "(", ")", "!="...
Removes a specific value from a list of values of the specified attribute. @param attribute the attribute from which to remote the value from. @param value the specific value to remove. @return true if the value was successfully removed. Otherwise, returns false,
[ "Removes", "a", "specific", "value", "from", "a", "list", "of", "values", "of", "the", "specified", "attribute", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L230-L234
99,821
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslAttributes.java
RslAttributes.removeMap
public boolean removeMap(String attribute, String key) { NameOpValue nv = rslTree.getParam(attribute); if (nv == null || nv.getOperator() != NameOpValue.EQ) return false; List values = nv.getValues(); Iterator iter = values.iterator(); Object obj; int i=0; int found = -1; while( iter.hasNext() ) { obj = it...
java
public boolean removeMap(String attribute, String key) { NameOpValue nv = rslTree.getParam(attribute); if (nv == null || nv.getOperator() != NameOpValue.EQ) return false; List values = nv.getValues(); Iterator iter = values.iterator(); Object obj; int i=0; int found = -1; while( iter.hasNext() ) { obj = it...
[ "public", "boolean", "removeMap", "(", "String", "attribute", ",", "String", "key", ")", "{", "NameOpValue", "nv", "=", "rslTree", ".", "getParam", "(", "attribute", ")", ";", "if", "(", "nv", "==", "null", "||", "nv", ".", "getOperator", "(", ")", "!=...
Removes a specific key from a list of values of the specified attribute. The attribute values must be in the right form. See the 'environment' rsl attribute. @param attribute the attribute to remove the key from. @param key the key to remove. @return true if the key was successfully removed. Otherwise, returns false.
[ "Removes", "a", "specific", "key", "from", "a", "list", "of", "values", "of", "the", "specified", "attribute", ".", "The", "attribute", "values", "must", "be", "in", "the", "right", "form", ".", "See", "the", "environment", "rsl", "attribute", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L246-L275
99,822
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslAttributes.java
RslAttributes.add
public void add(String attribute, String value) { NameOpValue nv = getRelation(attribute); nv.add(new Value(value)); }
java
public void add(String attribute, String value) { NameOpValue nv = getRelation(attribute); nv.add(new Value(value)); }
[ "public", "void", "add", "(", "String", "attribute", ",", "String", "value", ")", "{", "NameOpValue", "nv", "=", "getRelation", "(", "attribute", ")", ";", "nv", ".", "add", "(", "new", "Value", "(", "value", ")", ")", ";", "}" ]
Adds a simple value to the list of values of a given attribute. @param attribute the attribute to add the value to. @param value the value to add.
[ "Adds", "a", "simple", "value", "to", "the", "list", "of", "values", "of", "a", "given", "attribute", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L306-L309
99,823
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/RslAttributes.java
RslAttributes.setMulti
public void setMulti(String attribute, String [] values) { NameOpValue nv = getRelation(attribute); nv.clear(); List list = new LinkedList(); for (int i=0;i<values.length;i++) { list.add(new Value(values[i])); } nv.add(list); }
java
public void setMulti(String attribute, String [] values) { NameOpValue nv = getRelation(attribute); nv.clear(); List list = new LinkedList(); for (int i=0;i<values.length;i++) { list.add(new Value(values[i])); } nv.add(list); }
[ "public", "void", "setMulti", "(", "String", "attribute", ",", "String", "[", "]", "values", ")", "{", "NameOpValue", "nv", "=", "getRelation", "(", "attribute", ")", ";", "nv", ".", "clear", "(", ")", ";", "List", "list", "=", "new", "LinkedList", "("...
Sets the attribute value to the given list of values. The list of values is added as a single value. @param attribute the attribute to set the value of. @param values the list of values to add.
[ "Sets", "the", "attribute", "value", "to", "the", "given", "list", "of", "values", ".", "The", "list", "of", "values", "is", "added", "as", "a", "single", "value", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/RslAttributes.java#L318-L326
99,824
jglobus/JGlobus
ssl-proxies/src/main/java/org/globus/gsi/trustmanager/IdentityChecker.java
IdentityChecker.invoke
public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException { if (proxyCertValidator.getIdentityCertificate() == null) { // check if limited if (ProxyCertificateUtil.isLimitedProxy(certType)) { proxyCertValidator.setLi...
java
public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException { if (proxyCertValidator.getIdentityCertificate() == null) { // check if limited if (ProxyCertificateUtil.isLimitedProxy(certType)) { proxyCertValidator.setLi...
[ "public", "void", "invoke", "(", "X509Certificate", "cert", ",", "GSIConstants", ".", "CertificateType", "certType", ")", "throws", "CertPathValidatorException", "{", "if", "(", "proxyCertValidator", ".", "getIdentityCertificate", "(", ")", "==", "null", ")", "{", ...
Method that sets the identity of the certificate path. Also checks if limited proxy is acceptable. @throws CertPathValidatorException If limited proxies are not accepted and the chain has a limited proxy.
[ "Method", "that", "sets", "the", "identity", "of", "the", "certificate", "path", ".", "Also", "checks", "if", "limited", "proxy", "is", "acceptable", "." ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/IdentityChecker.java#L45-L62
99,825
korpling/ANNIS
annis-service/src/main/java/annis/sqlgen/DefaultWhereClauseGenerator.java
DefaultWhereClauseGenerator.notReflexive
private void notReflexive(List<String> conditions, QueryNode node, QueryNode target) { Validate.isTrue(node != target, "notReflexive(...) implies that source " + "and target node are not the same, but someone is violating this constraint!"); Validate.notNull(node); Validate.notNull(target); ...
java
private void notReflexive(List<String> conditions, QueryNode node, QueryNode target) { Validate.isTrue(node != target, "notReflexive(...) implies that source " + "and target node are not the same, but someone is violating this constraint!"); Validate.notNull(node); Validate.notNull(target); ...
[ "private", "void", "notReflexive", "(", "List", "<", "String", ">", "conditions", ",", "QueryNode", "node", ",", "QueryNode", "target", ")", "{", "Validate", ".", "isTrue", "(", "node", "!=", "target", ",", "\"notReflexive(...) implies that source \"", "+", "\"a...
Explicitly disallow reflexivity. Can be used if the other conditions allow reflexivity but the operator not. It depends on the search conditions if two results are not equal. <p> <b>For two nodes (including searches for token):</b> <br /> node IDs are different </p> <p> <b>If both nodes are an annotation:</b> <br /...
[ "Explicitly", "disallow", "reflexivity", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/sqlgen/DefaultWhereClauseGenerator.java#L146-L176
99,826
korpling/ANNIS
annis-service/src/main/java/annis/dao/AbstractDao.java
AbstractDao.executeSql
protected PreparedStatement executeSql(String sql, MapSqlParameterSource args) { // XXX: uses raw type, what are the parameters to Map in MapSqlParameterSource? Map<String, Object> parameters = args != null ? args.getValues() : new HashMap<String, Object>(); for (Map.Entry<String, Object> place...
java
protected PreparedStatement executeSql(String sql, MapSqlParameterSource args) { // XXX: uses raw type, what are the parameters to Map in MapSqlParameterSource? Map<String, Object> parameters = args != null ? args.getValues() : new HashMap<String, Object>(); for (Map.Entry<String, Object> place...
[ "protected", "PreparedStatement", "executeSql", "(", "String", "sql", ",", "MapSqlParameterSource", "args", ")", "{", "// XXX: uses raw type, what are the parameters to Map in MapSqlParameterSource?", "Map", "<", "String", ",", "Object", ">", "parameters", "=", "args", "!="...
executes an SQL string, substituting the parameters found in args @param sql @param args @return
[ "executes", "an", "SQL", "string", "substituting", "the", "parameters", "found", "in", "args" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/dao/AbstractDao.java#L65-L99
99,827
korpling/ANNIS
annis-service/src/main/java/annis/dao/AbstractDao.java
AbstractDao.readSqlFromResource
private String readSqlFromResource(Resource resource) { try (BufferedReader reader = new BufferedReader(new InputStreamReader( new FileInputStream( resource. getFile()), "UTF-8"));) { StringBuilder sqlBuf = new StringBuilder(); for (String line = reader.readLine(); line != ...
java
private String readSqlFromResource(Resource resource) { try (BufferedReader reader = new BufferedReader(new InputStreamReader( new FileInputStream( resource. getFile()), "UTF-8"));) { StringBuilder sqlBuf = new StringBuilder(); for (String line = reader.readLine(); line != ...
[ "private", "String", "readSqlFromResource", "(", "Resource", "resource", ")", "{", "try", "(", "BufferedReader", "reader", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "new", "FileInputStream", "(", "resource", ".", "getFile", "(", ")", ")...
Reads the content from a resource into a string. @param resource @return
[ "Reads", "the", "content", "from", "a", "resource", "into", "a", "string", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/dao/AbstractDao.java#L132-L155
99,828
korpling/ANNIS
annis-service/src/main/java/annis/ql/parser/DNFTransformer.java
DNFTransformer.toDNF
public static void toDNF(LogicClause topNode) { while(makeDNF(topNode) == false) { // do nothing, just repeat } cleanEmptyLeafs(topNode); flattenDNF(topNode); }
java
public static void toDNF(LogicClause topNode) { while(makeDNF(topNode) == false) { // do nothing, just repeat } cleanEmptyLeafs(topNode); flattenDNF(topNode); }
[ "public", "static", "void", "toDNF", "(", "LogicClause", "topNode", ")", "{", "while", "(", "makeDNF", "(", "topNode", ")", "==", "false", ")", "{", "// do nothing, just repeat", "}", "cleanEmptyLeafs", "(", "topNode", ")", ";", "flattenDNF", "(", "topNode", ...
Transforms an AQL query to the Disjunctive Normal Form. @param topNode @return
[ "Transforms", "an", "AQL", "query", "to", "the", "Disjunctive", "Normal", "Form", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/ql/parser/DNFTransformer.java#L36-L45
99,829
korpling/ANNIS
annis-service/src/main/java/annis/ql/parser/DNFTransformer.java
DNFTransformer.flattenDNF
private static void flattenDNF(LogicClause top) { if(top.getOp() == LogicClause.Operator.LEAF || top.getOp() == LogicClause.Operator.AND) { List<LogicClause> children = new ArrayList<>(); findAllChildrenForOp(top, children, LogicClause.Operator.AND); List<? extends Token> orginalAndCo...
java
private static void flattenDNF(LogicClause top) { if(top.getOp() == LogicClause.Operator.LEAF || top.getOp() == LogicClause.Operator.AND) { List<LogicClause> children = new ArrayList<>(); findAllChildrenForOp(top, children, LogicClause.Operator.AND); List<? extends Token> orginalAndCo...
[ "private", "static", "void", "flattenDNF", "(", "LogicClause", "top", ")", "{", "if", "(", "top", ".", "getOp", "(", ")", "==", "LogicClause", ".", "Operator", ".", "LEAF", "||", "top", ".", "getOp", "(", ")", "==", "LogicClause", ".", "Operator", ".",...
Flatten the clause in the sense that there is only one toplevel OR layer and one layer of AND-clauses. @param top
[ "Flatten", "the", "clause", "in", "the", "sense", "that", "there", "is", "only", "one", "toplevel", "OR", "layer", "and", "one", "layer", "of", "AND", "-", "clauses", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/ql/parser/DNFTransformer.java#L198-L266
99,830
korpling/ANNIS
annis-service/src/main/java/annis/dao/MetaDataFilter.java
MetaDataFilter.getDocumentsForMetadata
public List<Long> getDocumentsForMetadata(QueryData queryData) { List<Long> corpusList = queryData.getCorpusList(); if (!corpusList.isEmpty()) { List<QueryAnnotation> metaData = queryData.getMetaData(); if (!metaData.isEmpty()) { String documentsWithMetaDataSql = subQueryCo...
java
public List<Long> getDocumentsForMetadata(QueryData queryData) { List<Long> corpusList = queryData.getCorpusList(); if (!corpusList.isEmpty()) { List<QueryAnnotation> metaData = queryData.getMetaData(); if (!metaData.isEmpty()) { String documentsWithMetaDataSql = subQueryCo...
[ "public", "List", "<", "Long", ">", "getDocumentsForMetadata", "(", "QueryData", "queryData", ")", "{", "List", "<", "Long", ">", "corpusList", "=", "queryData", ".", "getCorpusList", "(", ")", ";", "if", "(", "!", "corpusList", ".", "isEmpty", "(", ")", ...
Will query the database which documents are matching according to the given metadata @param queryData QueryData from which the meta data will be extracted @return The list of documents matching the meta data or null if no constraints need to be applied (all documents are matching)
[ "Will", "query", "the", "database", "which", "documents", "are", "matching", "according", "to", "the", "given", "metadata" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/dao/MetaDataFilter.java#L42-L61
99,831
korpling/ANNIS
annis-gui/src/main/java/annis/gui/resultview/ResultViewPanel.java
ResultViewPanel.setQueryResultQueue
public void setQueryResultQueue(BlockingQueue<SaltProject> queue, PagedResultQuery q, ArrayList<Match> allMatches) { this.projectQueue = queue; this.currentQuery = q; this.numberOfResults = allMatches.size(); this.allMatches = allMatches; paging.setPageSize(q.getLimit(), false); paging.se...
java
public void setQueryResultQueue(BlockingQueue<SaltProject> queue, PagedResultQuery q, ArrayList<Match> allMatches) { this.projectQueue = queue; this.currentQuery = q; this.numberOfResults = allMatches.size(); this.allMatches = allMatches; paging.setPageSize(q.getLimit(), false); paging.se...
[ "public", "void", "setQueryResultQueue", "(", "BlockingQueue", "<", "SaltProject", ">", "queue", ",", "PagedResultQuery", "q", ",", "ArrayList", "<", "Match", ">", "allMatches", ")", "{", "this", ".", "projectQueue", "=", "queue", ";", "this", ".", "currentQue...
Set a new querys in result panel. @param queue holds the salt graph @param q holds the ordinary query @param allMatches All matches.
[ "Set", "a", "new", "querys", "in", "result", "panel", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/resultview/ResultViewPanel.java#L230-L250
99,832
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/Helper.java
Helper.createRESTClient
public static Client createRESTClient(String userName, String password) { DefaultApacheHttpClient4Config rc = new DefaultApacheHttpClient4Config(); rc.getClasses().add(SaltProjectProvider.class); ThreadSafeClientConnManager clientConnMgr = new ThreadSafeClientConnManager(); clientConnMgr.setDefaultM...
java
public static Client createRESTClient(String userName, String password) { DefaultApacheHttpClient4Config rc = new DefaultApacheHttpClient4Config(); rc.getClasses().add(SaltProjectProvider.class); ThreadSafeClientConnManager clientConnMgr = new ThreadSafeClientConnManager(); clientConnMgr.setDefaultM...
[ "public", "static", "Client", "createRESTClient", "(", "String", "userName", ",", "String", "password", ")", "{", "DefaultApacheHttpClient4Config", "rc", "=", "new", "DefaultApacheHttpClient4Config", "(", ")", ";", "rc", ".", "getClasses", "(", ")", ".", "add", ...
Creates an authentificiated REST client @param userName @param password @return A newly created client.
[ "Creates", "an", "authentificiated", "REST", "client" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L153-L181
99,833
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/Helper.java
Helper.getMetaDataDoc
public static List<Annotation> getMetaDataDoc(String toplevelCorpusName, String documentName) { List<Annotation> result = new ArrayList<Annotation>(); WebResource res = Helper.getAnnisWebResource(); try { res = res.path("meta").path("doc") .path(urlPathEscape.escape(toplevelCorpusNam...
java
public static List<Annotation> getMetaDataDoc(String toplevelCorpusName, String documentName) { List<Annotation> result = new ArrayList<Annotation>(); WebResource res = Helper.getAnnisWebResource(); try { res = res.path("meta").path("doc") .path(urlPathEscape.escape(toplevelCorpusNam...
[ "public", "static", "List", "<", "Annotation", ">", "getMetaDataDoc", "(", "String", "toplevelCorpusName", ",", "String", "documentName", ")", "{", "List", "<", "Annotation", ">", "result", "=", "new", "ArrayList", "<", "Annotation", ">", "(", ")", ";", "Web...
Retrieve the meta data for a given document of a corpus. @param toplevelCorpusName specifies the toplevel corpus @param documentName specifies the document. @return returns only the meta data for a single document.
[ "Retrieve", "the", "meta", "data", "for", "a", "given", "document", "of", "a", "corpus", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L527-L553
99,834
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/Helper.java
Helper.getCorpusConfig
public static CorpusConfig getCorpusConfig(String corpus) { if (corpus == null || corpus.isEmpty()) { Notification.show("no corpus is selected", "please select at leas one corpus and execute query again", Notification.Type.WARNING_MESSAGE); return null; } CorpusConfig cor...
java
public static CorpusConfig getCorpusConfig(String corpus) { if (corpus == null || corpus.isEmpty()) { Notification.show("no corpus is selected", "please select at leas one corpus and execute query again", Notification.Type.WARNING_MESSAGE); return null; } CorpusConfig cor...
[ "public", "static", "CorpusConfig", "getCorpusConfig", "(", "String", "corpus", ")", "{", "if", "(", "corpus", "==", "null", "||", "corpus", ".", "isEmpty", "(", ")", ")", "{", "Notification", ".", "show", "(", "\"no corpus is selected\"", ",", "\"please selec...
Loads the corpus config of a specific corpus. @param corpus The name of the corpus, for which the config is fetched. @return A {@link CorpusConfig} object, which wraps a {@link Properties} object. This Properties object stores the corpus configuration as simple key-value pairs.
[ "Loads", "the", "corpus", "config", "of", "a", "specific", "corpus", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L635-L665
99,835
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/Helper.java
Helper.getCorpusConfigs
public static CorpusConfigMap getCorpusConfigs() { CorpusConfigMap corpusConfigurations = null; try { corpusConfigurations = Helper.getAnnisWebResource().path( "query").path("corpora").path("config").get(CorpusConfigMap.class); } catch (UniformInterfaceException | ClientHandlerExce...
java
public static CorpusConfigMap getCorpusConfigs() { CorpusConfigMap corpusConfigurations = null; try { corpusConfigurations = Helper.getAnnisWebResource().path( "query").path("corpora").path("config").get(CorpusConfigMap.class); } catch (UniformInterfaceException | ClientHandlerExce...
[ "public", "static", "CorpusConfigMap", "getCorpusConfigs", "(", ")", "{", "CorpusConfigMap", "corpusConfigurations", "=", "null", ";", "try", "{", "corpusConfigurations", "=", "Helper", ".", "getAnnisWebResource", "(", ")", ".", "path", "(", "\"query\"", ")", ".",...
Loads the all available corpus configurations. @return A {@link CorpusConfigMap} object, which wraps a Map of {@link Properties} objects. The keys to the properties are the corpus names. A Properties object stores the corpus configuration as simple key-value pairs. The Map includes also the default corpus configurati...
[ "Loads", "the", "all", "available", "corpus", "configurations", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L699-L735
99,836
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/Helper.java
Helper.getCorpusConfigs
public static CorpusConfigMap getCorpusConfigs(Set<String> corpora) { CorpusConfigMap corpusConfigurations = new CorpusConfigMap(); for (String corpus : corpora) { corpusConfigurations.put(corpus, getCorpusConfig(corpus)); } corpusConfigurations.put(DEFAULT_CONFIG, getDefaultCorpusConfig(...
java
public static CorpusConfigMap getCorpusConfigs(Set<String> corpora) { CorpusConfigMap corpusConfigurations = new CorpusConfigMap(); for (String corpus : corpora) { corpusConfigurations.put(corpus, getCorpusConfig(corpus)); } corpusConfigurations.put(DEFAULT_CONFIG, getDefaultCorpusConfig(...
[ "public", "static", "CorpusConfigMap", "getCorpusConfigs", "(", "Set", "<", "String", ">", "corpora", ")", "{", "CorpusConfigMap", "corpusConfigurations", "=", "new", "CorpusConfigMap", "(", ")", ";", "for", "(", "String", "corpus", ":", "corpora", ")", "{", "...
Loads the available corpus configurations for a list of specific corpora. @param corpora A Set of corpora names. @return A {@link CorpusConfigMap} object, which wraps a Map of {@link Properties} objects. The keys to the properties are the corpus names. A Properties object stores the corpus configuration as simple key...
[ "Loads", "the", "available", "corpus", "configurations", "for", "a", "list", "of", "specific", "corpora", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L747-L759
99,837
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/Helper.java
Helper.parseFragment
public static Map<String, String> parseFragment(String fragment) { Map<String, String> result = new TreeMap<String, String>(); fragment = StringUtils.removeStart(fragment, "!"); String[] split = StringUtils.split(fragment, "&"); for (String s : split) { String[] parts = s.split("=", 2); ...
java
public static Map<String, String> parseFragment(String fragment) { Map<String, String> result = new TreeMap<String, String>(); fragment = StringUtils.removeStart(fragment, "!"); String[] split = StringUtils.split(fragment, "&"); for (String s : split) { String[] parts = s.split("=", 2); ...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "parseFragment", "(", "String", "fragment", ")", "{", "Map", "<", "String", ",", "String", ">", "result", "=", "new", "TreeMap", "<", "String", ",", "String", ">", "(", ")", ";", "fragment",...
Parses the fragment. Fragments have the form key1=value&key2=test ... @param fragment @return
[ "Parses", "the", "fragment", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L769-L805
99,838
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/Helper.java
Helper.convertExceptionToMessage
public static String convertExceptionToMessage(Throwable ex) { StringBuilder sb = new StringBuilder(); if(ex != null) { sb.append("Exception type: ").append(ex.getClass().getName()).append("\n"); sb.append("Message: ").append(ex.getLocalizedMessage()).append("\n"); sb.append("Stacktrace:...
java
public static String convertExceptionToMessage(Throwable ex) { StringBuilder sb = new StringBuilder(); if(ex != null) { sb.append("Exception type: ").append(ex.getClass().getName()).append("\n"); sb.append("Message: ").append(ex.getLocalizedMessage()).append("\n"); sb.append("Stacktrace:...
[ "public", "static", "String", "convertExceptionToMessage", "(", "Throwable", "ex", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "ex", "!=", "null", ")", "{", "sb", ".", "append", "(", "\"Exception type: \"", ")", ...
Returns a formatted string containing the type of the exception, the message and the stacktrace. @param ex @return
[ "Returns", "a", "formatted", "string", "containing", "the", "type", "of", "the", "exception", "the", "message", "and", "the", "stacktrace", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L814-L830
99,839
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/Helper.java
Helper.encodePath
public static String encodePath(String v) { String encoded = urlPathEscape.escape(v); return encoded; }
java
public static String encodePath(String v) { String encoded = urlPathEscape.escape(v); return encoded; }
[ "public", "static", "String", "encodePath", "(", "String", "v", ")", "{", "String", "encoded", "=", "urlPathEscape", ".", "escape", "(", "v", ")", ";", "return", "encoded", ";", "}" ]
Encodes a String so it can be used as path param. @param v @return
[ "Encodes", "a", "String", "so", "it", "can", "be", "used", "as", "path", "param", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L911-L915
99,840
korpling/ANNIS
annis-libgui/src/main/java/annis/libgui/Helper.java
Helper.encodeQueryParam
public static String encodeQueryParam(String v) { String encoded = UrlEscapers.urlFormParameterEscaper().escape(v); return encoded; }
java
public static String encodeQueryParam(String v) { String encoded = UrlEscapers.urlFormParameterEscaper().escape(v); return encoded; }
[ "public", "static", "String", "encodeQueryParam", "(", "String", "v", ")", "{", "String", "encoded", "=", "UrlEscapers", ".", "urlFormParameterEscaper", "(", ")", ".", "escape", "(", "v", ")", ";", "return", "encoded", ";", "}" ]
Encodes a String so it can be used as query param. @param v @return
[ "Encodes", "a", "String", "so", "it", "can", "be", "used", "as", "query", "param", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Helper.java#L923-L927
99,841
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/iframe/WriterVisualizer.java
WriterVisualizer.writeOutput
@Override public void writeOutput(VisualizerInput input, OutputStream outstream) { try { OutputStreamWriter writer = new OutputStreamWriter(outstream, getCharacterEncoding()); writeOutput(input, writer); writer.flush(); } catch(IOException ex) { log.error("Exception when ...
java
@Override public void writeOutput(VisualizerInput input, OutputStream outstream) { try { OutputStreamWriter writer = new OutputStreamWriter(outstream, getCharacterEncoding()); writeOutput(input, writer); writer.flush(); } catch(IOException ex) { log.error("Exception when ...
[ "@", "Override", "public", "void", "writeOutput", "(", "VisualizerInput", "input", ",", "OutputStream", "outstream", ")", "{", "try", "{", "OutputStreamWriter", "writer", "=", "new", "OutputStreamWriter", "(", "outstream", ",", "getCharacterEncoding", "(", ")", ")...
Will create a Writer of the outstream. @param outstream
[ "Will", "create", "a", "Writer", "of", "the", "outstream", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/iframe/WriterVisualizer.java#L41-L64
99,842
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java
SentStructureJsComponent.getRelationLevelSet
private static Set<String> getRelationLevelSet(SDocumentGraph graph, String namespace, Class<? extends SRelation> type) { Set<String> result = new TreeSet<>(); if (graph != null) { List<? extends SRelation> edges = null; if (type == SDominanceRelation.class) { edges = graph.getDominanceRelations(); ...
java
private static Set<String> getRelationLevelSet(SDocumentGraph graph, String namespace, Class<? extends SRelation> type) { Set<String> result = new TreeSet<>(); if (graph != null) { List<? extends SRelation> edges = null; if (type == SDominanceRelation.class) { edges = graph.getDominanceRelations(); ...
[ "private", "static", "Set", "<", "String", ">", "getRelationLevelSet", "(", "SDocumentGraph", "graph", ",", "String", "namespace", ",", "Class", "<", "?", "extends", "SRelation", ">", "type", ")", "{", "Set", "<", "String", ">", "result", "=", "new", "Tree...
Get the qualified name of all annotations belonging to relations having a specific namespace. @param graph The graph. @param namespace The namespace of the relation (not the annotation) to search for. If namespace is null all namespaces will be considered. @param type Which type of relation to include @return
[ "Get", "the", "qualified", "name", "of", "all", "annotations", "belonging", "to", "relations", "having", "a", "specific", "namespace", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java#L385-L415
99,843
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java
SentStructureJsComponent.includeNode
@Override public boolean includeNode(SNode node) { // if node is a token or no configuration set, output the node if (node instanceof SToken || configurations.get(0) == null) { return true; } Set<SAnnotation> nodeAnnotations = node.getAnnotations(); return includeObject(nodeAnnotations, displayedNodeAnn...
java
@Override public boolean includeNode(SNode node) { // if node is a token or no configuration set, output the node if (node instanceof SToken || configurations.get(0) == null) { return true; } Set<SAnnotation> nodeAnnotations = node.getAnnotations(); return includeObject(nodeAnnotations, displayedNodeAnn...
[ "@", "Override", "public", "boolean", "includeNode", "(", "SNode", "node", ")", "{", "// if node is a token or no configuration set, output the node", "if", "(", "node", "instanceof", "SToken", "||", "configurations", ".", "get", "(", "0", ")", "==", "null", ")", ...
Implements the includeNode method of the org.corpus_tools.salt.util.ExportFilter interface.
[ "Implements", "the", "includeNode", "method", "of", "the", "org", ".", "corpus_tools", ".", "salt", ".", "util", ".", "ExportFilter", "interface", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java#L421-L431
99,844
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java
SentStructureJsComponent.includeRelation
@Override public boolean includeRelation(SRelation relation) { Map<String, Set<String>> displayedRelAnnotations = new HashMap<String, Set<String>>(); // if no configuration set output the relation if (relation instanceof SPointingRelation) { if (configurations.get(1) == null) { return true; } else { ...
java
@Override public boolean includeRelation(SRelation relation) { Map<String, Set<String>> displayedRelAnnotations = new HashMap<String, Set<String>>(); // if no configuration set output the relation if (relation instanceof SPointingRelation) { if (configurations.get(1) == null) { return true; } else { ...
[ "@", "Override", "public", "boolean", "includeRelation", "(", "SRelation", "relation", ")", "{", "Map", "<", "String", ",", "Set", "<", "String", ">", ">", "displayedRelAnnotations", "=", "new", "HashMap", "<", "String", ",", "Set", "<", "String", ">", ">"...
Implements the includeRelation method of the org.corpus_tools.salt.util.ExportFilter interface.
[ "Implements", "the", "includeRelation", "method", "of", "the", "org", ".", "corpus_tools", ".", "salt", ".", "util", ".", "ExportFilter", "interface", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/sentstructurejs/SentStructureJsComponent.java#L438-L470
99,845
korpling/ANNIS
annis-interfaces/src/main/java/annis/CommonHelper.java
CommonHelper.containsRTLText
public static boolean containsRTLText(String str) { if (str != null) { for (int i = 0; i < str.length(); i++) { char cc = str.charAt(i); // hebrew extended and basic, arabic basic and extendend if (cc >= 1425 && cc <= 1785) { return true; } ...
java
public static boolean containsRTLText(String str) { if (str != null) { for (int i = 0; i < str.length(); i++) { char cc = str.charAt(i); // hebrew extended and basic, arabic basic and extendend if (cc >= 1425 && cc <= 1785) { return true; } ...
[ "public", "static", "boolean", "containsRTLText", "(", "String", "str", ")", "{", "if", "(", "str", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "str", ".", "length", "(", ")", ";", "i", "++", ")", "{", "char", "cc",...
Detects arabic characters in a string. <p> Every character is checked, if its bit representation lies between: <code>[1425, 1785] | [64286, 65019] | [65136, 65276]</code> </p> @param str The string to be checked. @return returns true, if arabic characters are detected.
[ "Detects", "arabic", "characters", "in", "a", "string", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/CommonHelper.java#L81-L106
99,846
korpling/ANNIS
annis-interfaces/src/main/java/annis/CommonHelper.java
CommonHelper.getSafeFileName
public static String getSafeFileName(String orig) { if (orig != null) { return orig.replaceAll("[^0-9A-Za-z-]", "_"); } else { return UUID.randomUUID().toString(); } }
java
public static String getSafeFileName(String orig) { if (orig != null) { return orig.replaceAll("[^0-9A-Za-z-]", "_"); } else { return UUID.randomUUID().toString(); } }
[ "public", "static", "String", "getSafeFileName", "(", "String", "orig", ")", "{", "if", "(", "orig", "!=", "null", ")", "{", "return", "orig", ".", "replaceAll", "(", "\"[^0-9A-Za-z-]\"", ",", "\"_\"", ")", ";", "}", "else", "{", "return", "UUID", ".", ...
Returns a file name that is safe to use and does not have any invalid characters. @param orig @return
[ "Returns", "a", "file", "name", "that", "is", "safe", "to", "use", "and", "does", "not", "have", "any", "invalid", "characters", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/CommonHelper.java#L388-L398
99,847
korpling/ANNIS
annis-interfaces/src/main/java/annis/CommonHelper.java
CommonHelper.getToplevelCorpusNames
public static Set<String> getToplevelCorpusNames(SaltProject p) { Set<String> names = new HashSet<>(); if (p != null && p.getCorpusGraphs() != null) { for (SCorpusGraph g : p.getCorpusGraphs()) { if (g.getRoots() != null) { for (SNode c : g.getRoots()) { ...
java
public static Set<String> getToplevelCorpusNames(SaltProject p) { Set<String> names = new HashSet<>(); if (p != null && p.getCorpusGraphs() != null) { for (SCorpusGraph g : p.getCorpusGraphs()) { if (g.getRoots() != null) { for (SNode c : g.getRoots()) { ...
[ "public", "static", "Set", "<", "String", ">", "getToplevelCorpusNames", "(", "SaltProject", "p", ")", "{", "Set", "<", "String", ">", "names", "=", "new", "HashSet", "<>", "(", ")", ";", "if", "(", "p", "!=", "null", "&&", "p", ".", "getCorpusGraphs",...
Gets all names of a corpus from a salt project. @param p @return returns an empty list if project is empty or null.
[ "Gets", "all", "names", "of", "a", "corpus", "from", "a", "salt", "project", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/CommonHelper.java#L406-L425
99,848
korpling/ANNIS
annis-interfaces/src/main/java/annis/CommonHelper.java
CommonHelper.createSNodeMapFromIDs
public static <V> Map<SNode, V> createSNodeMapFromIDs(Map<String, V> map, SDocumentGraph graph) { HashMap<SNode, V> result = new LinkedHashMap<>(); if (map != null && graph != null) { for (Map.Entry<String, V> e : map.entrySet()) { SNode n = graph.getNode(e.getKey()); if (...
java
public static <V> Map<SNode, V> createSNodeMapFromIDs(Map<String, V> map, SDocumentGraph graph) { HashMap<SNode, V> result = new LinkedHashMap<>(); if (map != null && graph != null) { for (Map.Entry<String, V> e : map.entrySet()) { SNode n = graph.getNode(e.getKey()); if (...
[ "public", "static", "<", "V", ">", "Map", "<", "SNode", ",", "V", ">", "createSNodeMapFromIDs", "(", "Map", "<", "String", ",", "V", ">", "map", ",", "SDocumentGraph", "graph", ")", "{", "HashMap", "<", "SNode", ",", "V", ">", "result", "=", "new", ...
Takes a map of salt node IDs to a value and return a new map that uses the SNodes as keys instead of the IDs. @param <V> @param map @param graph @return
[ "Takes", "a", "map", "of", "salt", "node", "IDs", "to", "a", "value", "and", "return", "a", "new", "map", "that", "uses", "the", "SNodes", "as", "keys", "instead", "of", "the", "IDs", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/CommonHelper.java#L436-L454
99,849
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java
EventExtractor.parseSalt
public static LinkedHashMap<String, ArrayList<Row>> parseSalt( VisualizerInput input, boolean showSpanAnnos, boolean showTokenAnnos, List<String> annotationNames, Set<String> mediaLayer, boolean replaceValueWithMediaIcon, long startTokenIndex, long endTokenIndex, PDFCo...
java
public static LinkedHashMap<String, ArrayList<Row>> parseSalt( VisualizerInput input, boolean showSpanAnnos, boolean showTokenAnnos, List<String> annotationNames, Set<String> mediaLayer, boolean replaceValueWithMediaIcon, long startTokenIndex, long endTokenIndex, PDFCo...
[ "public", "static", "LinkedHashMap", "<", "String", ",", "ArrayList", "<", "Row", ">", ">", "parseSalt", "(", "VisualizerInput", "input", ",", "boolean", "showSpanAnnos", ",", "boolean", "showTokenAnnos", ",", "List", "<", "String", ">", "annotationNames", ",", ...
Converts Salt document graph to rows. @param input @param showSpanAnnos @param showTokenAnnos @param mediaLayer A set of all annotation layers which should be treated as special media layer. @param annotationNames @param replaceValueWithMediaIcon If true the actual value is removed and an icon for playing the media f...
[ "Converts", "Salt", "document", "graph", "to", "rows", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java#L92-L167
99,850
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java
EventExtractor.computeDisplayedNamespace
public static Set<String> computeDisplayedNamespace(VisualizerInput input, List<Class<? extends SNode>> types) { if (input == null) { return new HashSet<>(); } String showNamespaceConfig = input.getMappings().getProperty( GridComponent.MAPPING_SHOW_NAMESPACE); if (s...
java
public static Set<String> computeDisplayedNamespace(VisualizerInput input, List<Class<? extends SNode>> types) { if (input == null) { return new HashSet<>(); } String showNamespaceConfig = input.getMappings().getProperty( GridComponent.MAPPING_SHOW_NAMESPACE); if (s...
[ "public", "static", "Set", "<", "String", ">", "computeDisplayedNamespace", "(", "VisualizerInput", "input", ",", "List", "<", "Class", "<", "?", "extends", "SNode", ">", ">", "types", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "new"...
Returns the annotations to which should be displayed together with their namespace. This will check the "show_ns" paramter for determining. the annotations to display. It also iterates over all nodes of the graph matching the type. @param input The input for the visualizer. @param types Which types of nodes to includ...
[ "Returns", "the", "annotations", "to", "which", "should", "be", "displayed", "together", "with", "their", "namespace", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java#L521-L593
99,851
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java
EventExtractor.getAnnotationLevelSet
private static Set<String> getAnnotationLevelSet(SDocumentGraph graph, String namespace, Class<? extends SNode> type) { Set<String> result = new TreeSet<>(); if (graph != null) { List<? extends SNode> nodes; // catch most common cases directly if (SSpan.class == type) { node...
java
private static Set<String> getAnnotationLevelSet(SDocumentGraph graph, String namespace, Class<? extends SNode> type) { Set<String> result = new TreeSet<>(); if (graph != null) { List<? extends SNode> nodes; // catch most common cases directly if (SSpan.class == type) { node...
[ "private", "static", "Set", "<", "String", ">", "getAnnotationLevelSet", "(", "SDocumentGraph", "graph", ",", "String", "namespace", ",", "Class", "<", "?", "extends", "SNode", ">", "type", ")", "{", "Set", "<", "String", ">", "result", "=", "new", "TreeSe...
Get the qualified name of all annotations belonging to spans having a specific namespace. @param graph The graph. @param namespace The namespace of the node (not the annotation) to search for. @param type Which type of nodes to include @return
[ "Get", "the", "qualified", "name", "of", "all", "annotations", "belonging", "to", "spans", "having", "a", "specific", "namespace", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java#L606-L638
99,852
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java
EventExtractor.sortEventsByTokenIndex
private static void sortEventsByTokenIndex(Row row) { Collections.sort(row.getEvents(), new Comparator<GridEvent>() { @Override public int compare(GridEvent o1, GridEvent o2) { if (o1 == o2) { return 0; } if (o1 == null) { return -1; } if (o2 =...
java
private static void sortEventsByTokenIndex(Row row) { Collections.sort(row.getEvents(), new Comparator<GridEvent>() { @Override public int compare(GridEvent o1, GridEvent o2) { if (o1 == o2) { return 0; } if (o1 == null) { return -1; } if (o2 =...
[ "private", "static", "void", "sortEventsByTokenIndex", "(", "Row", "row", ")", "{", "Collections", ".", "sort", "(", "row", ".", "getEvents", "(", ")", ",", "new", "Comparator", "<", "GridEvent", ">", "(", ")", "{", "@", "Override", "public", "int", "com...
Sort events of a row. The sorting is depending on the left value of the event @param row
[ "Sort", "events", "of", "a", "row", ".", "The", "sorting", "is", "depending", "on", "the", "left", "value", "of", "the", "event" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java#L690-L707
99,853
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java
EventExtractor.splitRowsOnIslands
private static void splitRowsOnIslands(Row row, final SDocumentGraph graph, STextualDS text, long startTokenIndex, long endTokenIndex) { BitSet tokenCoverage = new BitSet(); // get the sorted token List<SToken> sortedTokenList = graph.getSortedTokenByText(); // add all token belongin...
java
private static void splitRowsOnIslands(Row row, final SDocumentGraph graph, STextualDS text, long startTokenIndex, long endTokenIndex) { BitSet tokenCoverage = new BitSet(); // get the sorted token List<SToken> sortedTokenList = graph.getSortedTokenByText(); // add all token belongin...
[ "private", "static", "void", "splitRowsOnIslands", "(", "Row", "row", ",", "final", "SDocumentGraph", "graph", ",", "STextualDS", "text", ",", "long", "startTokenIndex", ",", "long", "endTokenIndex", ")", "{", "BitSet", "tokenCoverage", "=", "new", "BitSet", "("...
Splits events of a row if they overlap an island. Islands are areas between the token which are included in the result. @param row @param graph @param text @param startTokenIndex token index of the first token in the match @param endTokenIndex token index of the last token in the match
[ "Splits", "events", "of", "a", "row", "if", "they", "overlap", "an", "island", ".", "Islands", "are", "areas", "between", "the", "token", "which", "are", "included", "in", "the", "result", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/grid/EventExtractor.java#L719-L784
99,854
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/iframe/dependency/VakyarthaDependencyTree.java
VakyarthaDependencyTree.getText
private String getText(SNode node, VisualizerInput input) { SDocumentGraph sDocumentGraph = input.getSResult().getDocumentGraph(); List<DataSourceSequence> sequences = sDocumentGraph. getOverlappedDataSourceSequence(node, SALT_TYPE.STEXT_OVERLAPPING_RELATION); if (sequences != null && sequences.si...
java
private String getText(SNode node, VisualizerInput input) { SDocumentGraph sDocumentGraph = input.getSResult().getDocumentGraph(); List<DataSourceSequence> sequences = sDocumentGraph. getOverlappedDataSourceSequence(node, SALT_TYPE.STEXT_OVERLAPPING_RELATION); if (sequences != null && sequences.si...
[ "private", "String", "getText", "(", "SNode", "node", ",", "VisualizerInput", "input", ")", "{", "SDocumentGraph", "sDocumentGraph", "=", "input", ".", "getSResult", "(", ")", ".", "getDocumentGraph", "(", ")", ";", "List", "<", "DataSourceSequence", ">", "seq...
Get the text which is overlapped by the SNode. @return Empty string, if there are no token overlapped by the node.
[ "Get", "the", "text", "which", "is", "overlapped", "by", "the", "SNode", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/iframe/dependency/VakyarthaDependencyTree.java#L388-L402
99,855
korpling/ANNIS
annis-gui/src/main/java/annis/gui/MainToolbar.java
MainToolbar.addLoginButton
private void addLoginButton() { VaadinSession session = VaadinSession.getCurrent(); if (session != null) { boolean kickstarter = Helper.isKickstarter(session); if (!kickstarter) { addComponent(lblUserName); setComponentAlignment(lblUserName, Alignment.MIDDLE_RIGHT); ...
java
private void addLoginButton() { VaadinSession session = VaadinSession.getCurrent(); if (session != null) { boolean kickstarter = Helper.isKickstarter(session); if (!kickstarter) { addComponent(lblUserName); setComponentAlignment(lblUserName, Alignment.MIDDLE_RIGHT); ...
[ "private", "void", "addLoginButton", "(", ")", "{", "VaadinSession", "session", "=", "VaadinSession", ".", "getCurrent", "(", ")", ";", "if", "(", "session", "!=", "null", ")", "{", "boolean", "kickstarter", "=", "Helper", ".", "isKickstarter", "(", "session...
Adds the login button + login text to the toolbar. This is only happened, when the gui is not started via the kickstarter. <p> The Kickstarter overrides the "kickstarterEnvironment" context parameter and set it to "true", so the gui can detect, that is not necessary to offer a login button.</p> component.
[ "Adds", "the", "login", "button", "+", "login", "text", "to", "the", "toolbar", ".", "This", "is", "only", "happened", "when", "the", "gui", "is", "not", "started", "via", "the", "kickstarter", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/MainToolbar.java#L435-L451
99,856
korpling/ANNIS
annis-service/src/main/java/annis/sqlgen/AnnotationConditionProvider.java
AnnotationConditionProvider.addAnnotationConditions
public void addAnnotationConditions(Collection<String> conditions, int index, QueryAnnotation annotation, String table, TableAccessStrategy tas) { TextMatching tm = annotation.getTextMatching(); String column = annotation.getNamespace() == null ? "annotext" : "qannotext"; Escaper escaper =...
java
public void addAnnotationConditions(Collection<String> conditions, int index, QueryAnnotation annotation, String table, TableAccessStrategy tas) { TextMatching tm = annotation.getTextMatching(); String column = annotation.getNamespace() == null ? "annotext" : "qannotext"; Escaper escaper =...
[ "public", "void", "addAnnotationConditions", "(", "Collection", "<", "String", ">", "conditions", ",", "int", "index", ",", "QueryAnnotation", "annotation", ",", "String", "table", ",", "TableAccessStrategy", "tas", ")", "{", "TextMatching", "tm", "=", "annotation...
Adds annotation conditions for a single node. @param conditions Condition list where the conditions should be added to @param index Index for a specific annotation @param annotation The annotation to add @param table Table to operate on @param tas {@link TableAccessStrategy} for the given node.
[ "Adds", "annotation", "conditions", "for", "a", "single", "node", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/sqlgen/AnnotationConditionProvider.java#L56-L112
99,857
korpling/ANNIS
annis-interfaces/src/main/java/annis/service/objects/FrequencyTableEntry.java
FrequencyTableEntry.parse
public static FrequencyTableEntry parse(String definition) { List<String> splitted = Splitter.on(':').trimResults().omitEmptyStrings().limit(2). splitToList(definition); if (splitted.size() == 2) { FrequencyTableEntry entry = new FrequencyTableEntry(); if ("meta".equals(splitted.g...
java
public static FrequencyTableEntry parse(String definition) { List<String> splitted = Splitter.on(':').trimResults().omitEmptyStrings().limit(2). splitToList(definition); if (splitted.size() == 2) { FrequencyTableEntry entry = new FrequencyTableEntry(); if ("meta".equals(splitted.g...
[ "public", "static", "FrequencyTableEntry", "parse", "(", "String", "definition", ")", "{", "List", "<", "String", ">", "splitted", "=", "Splitter", ".", "on", "(", "'", "'", ")", ".", "trimResults", "(", ")", ".", "omitEmptyStrings", "(", ")", ".", "limi...
A constructor that takes the raw definition as argument. A definition consists of two parts: the referenced node and the annotation name or "tok" separated by ":" @param definition @return
[ "A", "constructor", "that", "takes", "the", "raw", "definition", "as", "argument", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-interfaces/src/main/java/annis/service/objects/FrequencyTableEntry.java#L47-L78
99,858
korpling/ANNIS
annis-gui/src/main/java/annis/gui/controlpanel/CorpusListPanel.java
CorpusListPanel.updateAutoGeneratedQueriesPanel
private void updateAutoGeneratedQueriesPanel() { // make sure to make a copy since we are adding items to this set Set<String> corpora = new HashSet<>(ui.getQueryState().getSelectedCorpora(). getValue()); if (corpora.isEmpty()) { corpora.addAll(ui.getQueryState().getAvailableCorpora().get...
java
private void updateAutoGeneratedQueriesPanel() { // make sure to make a copy since we are adding items to this set Set<String> corpora = new HashSet<>(ui.getQueryState().getSelectedCorpora(). getValue()); if (corpora.isEmpty()) { corpora.addAll(ui.getQueryState().getAvailableCorpora().get...
[ "private", "void", "updateAutoGeneratedQueriesPanel", "(", ")", "{", "// make sure to make a copy since we are adding items to this set", "Set", "<", "String", ">", "corpora", "=", "new", "HashSet", "<>", "(", "ui", ".", "getQueryState", "(", ")", ".", "getSelectedCorpo...
Updates or initializes the panel, which holds the automatic generated queries.
[ "Updates", "or", "initializes", "the", "panel", "which", "holds", "the", "automatic", "generated", "queries", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-gui/src/main/java/annis/gui/controlpanel/CorpusListPanel.java#L392-L403
99,859
korpling/ANNIS
annis-service/src/main/java/annis/administration/AbstractAdminstrationDao.java
AbstractAdminstrationDao.existConflictingTopLevelCorpus
protected boolean existConflictingTopLevelCorpus(String topLevelCorpusName) { String sql = "SELECT count(name) as amount FROM corpus WHERE top_level=true AND name='" + topLevelCorpusName + "'"; Integer numberOfCorpora = getJdbcTemplate().query(sql, new ResultSetExtractor<Integer>() { ...
java
protected boolean existConflictingTopLevelCorpus(String topLevelCorpusName) { String sql = "SELECT count(name) as amount FROM corpus WHERE top_level=true AND name='" + topLevelCorpusName + "'"; Integer numberOfCorpora = getJdbcTemplate().query(sql, new ResultSetExtractor<Integer>() { ...
[ "protected", "boolean", "existConflictingTopLevelCorpus", "(", "String", "topLevelCorpusName", ")", "{", "String", "sql", "=", "\"SELECT count(name) as amount FROM corpus WHERE top_level=true AND name='\"", "+", "topLevelCorpusName", "+", "\"'\"", ";", "Integer", "numberOfCorpora...
Checks, if there already exists a top level corpus. @param topLevelCorpusName The name of the corpus, which is checked. @return Is false, if the no top level coprpus exists.
[ "Checks", "if", "there", "already", "exists", "a", "top", "level", "corpus", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AbstractAdminstrationDao.java#L84-L107
99,860
korpling/ANNIS
annis-service/src/main/java/annis/administration/AbstractAdminstrationDao.java
AbstractAdminstrationDao.closeAllConnections
protected void closeAllConnections(String databasename) { String sql = "SELECT pg_terminate_backend(pg_stat_activity.pid)\n" + "FROM pg_stat_activity\n" + "WHERE pg_stat_activity.datname = ?\n" + " AND pid <> pg_backend_pid();"; try(Connection conn = getDataSource().getConnection()) ...
java
protected void closeAllConnections(String databasename) { String sql = "SELECT pg_terminate_backend(pg_stat_activity.pid)\n" + "FROM pg_stat_activity\n" + "WHERE pg_stat_activity.datname = ?\n" + " AND pid <> pg_backend_pid();"; try(Connection conn = getDataSource().getConnection()) ...
[ "protected", "void", "closeAllConnections", "(", "String", "databasename", ")", "{", "String", "sql", "=", "\"SELECT pg_terminate_backend(pg_stat_activity.pid)\\n\"", "+", "\"FROM pg_stat_activity\\n\"", "+", "\"WHERE pg_stat_activity.datname = ?\\n\"", "+", "\" AND pid <> pg_back...
Closes all open idle connections. The current data source must have superuser rights. This can be used if a another database action needs full access to a database, e.g. when deleting and then creating it @param databasename
[ "Closes", "all", "open", "idle", "connections", ".", "The", "current", "data", "source", "must", "have", "superuser", "rights", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/administration/AbstractAdminstrationDao.java#L134-L162
99,861
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java
RSTImpl.getText
private String getText(SToken currNode) { List<DataSourceSequence> sSequences = ((SDocumentGraph) currNode.getGraph()). getOverlappedDataSourceSequence(currNode, SALT_TYPE.STEXT_OVERLAPPING_RELATION); // only support one text for spanns if (sSequences == null || sSequences.size() != 1) { ...
java
private String getText(SToken currNode) { List<DataSourceSequence> sSequences = ((SDocumentGraph) currNode.getGraph()). getOverlappedDataSourceSequence(currNode, SALT_TYPE.STEXT_OVERLAPPING_RELATION); // only support one text for spanns if (sSequences == null || sSequences.size() != 1) { ...
[ "private", "String", "getText", "(", "SToken", "currNode", ")", "{", "List", "<", "DataSourceSequence", ">", "sSequences", "=", "(", "(", "SDocumentGraph", ")", "currNode", ".", "getGraph", "(", ")", ")", ".", "getOverlappedDataSourceSequence", "(", "currNode", ...
Gets the overlapping token as string from a node, which are direct dominated by this node. @param currNode @return is null, if there is no relation to a token, or there is more then one STEXT is overlapped by this node
[ "Gets", "the", "overlapping", "token", "as", "string", "from", "a", "node", "which", "are", "direct", "dominated", "by", "this", "node", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java#L492-L527
99,862
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java
RSTImpl.getHTMLColor
private String getHTMLColor(SToken token) { if (!markedAndCovered.containsKey(token)) { return null; } /** * Since the range in markedAndCovered is from 1 up to 8, we have to * decrease the value, for matching the colors in KWIC. */ int color = (int) (long) markedAndCovered.get(to...
java
private String getHTMLColor(SToken token) { if (!markedAndCovered.containsKey(token)) { return null; } /** * Since the range in markedAndCovered is from 1 up to 8, we have to * decrease the value, for matching the colors in KWIC. */ int color = (int) (long) markedAndCovered.get(to...
[ "private", "String", "getHTMLColor", "(", "SToken", "token", ")", "{", "if", "(", "!", "markedAndCovered", ".", "containsKey", "(", "token", ")", ")", "{", "return", "null", ";", "}", "/**\n * Since the range in markedAndCovered is from 1 up to 8, we have to\n *...
Checks, if a specific token is marked as matching token and returns a HTML color string. @return is null when token is not marked
[ "Checks", "if", "a", "specific", "token", "is", "marked", "as", "matching", "token", "and", "returns", "a", "HTML", "color", "string", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java#L603-L618
99,863
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java
RSTImpl.isSegment
private boolean isSegment(SNode currNode) { List<SRelation<SNode, SNode>> edges = currNode.getGraph().getOutRelations(currNode.getId()); if (edges != null && edges.size() > 0) { for (SRelation<SNode, SNode> edge : edges) { if (edge.getTarget() instanceof SToken) { return true; ...
java
private boolean isSegment(SNode currNode) { List<SRelation<SNode, SNode>> edges = currNode.getGraph().getOutRelations(currNode.getId()); if (edges != null && edges.size() > 0) { for (SRelation<SNode, SNode> edge : edges) { if (edge.getTarget() instanceof SToken) { return true; ...
[ "private", "boolean", "isSegment", "(", "SNode", "currNode", ")", "{", "List", "<", "SRelation", "<", "SNode", ",", "SNode", ">", ">", "edges", "=", "currNode", ".", "getGraph", "(", ")", ".", "getOutRelations", "(", "currNode", ".", "getId", "(", ")", ...
Checks, if there exists an SRelation which targets a SToken.
[ "Checks", "if", "there", "exists", "an", "SRelation", "which", "targets", "a", "SToken", "." ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java#L623-L636
99,864
korpling/ANNIS
annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java
RSTImpl.sortChildren
private void sortChildren(JSONObject root) throws JSONException { JSONArray children = root.getJSONArray("children"); List<JSONObject> childrenSorted = new ArrayList<JSONObject>(children. length()); for (int i = 0; i < children.length(); i++) { childrenSorted.add(children.getJSONObject(i)...
java
private void sortChildren(JSONObject root) throws JSONException { JSONArray children = root.getJSONArray("children"); List<JSONObject> childrenSorted = new ArrayList<JSONObject>(children. length()); for (int i = 0; i < children.length(); i++) { childrenSorted.add(children.getJSONObject(i)...
[ "private", "void", "sortChildren", "(", "JSONObject", "root", ")", "throws", "JSONException", "{", "JSONArray", "children", "=", "root", ".", "getJSONArray", "(", "\"children\"", ")", ";", "List", "<", "JSONObject", ">", "childrenSorted", "=", "new", "ArrayList"...
Sorts the children of root by the the sentence indizes. Since the sentence indizes are based on the token indizes, some sentences have no sentences indizes, because sometimes token nodes are out of context. A kind of insertion sort would be better than the used mergesort. And it is a pity that the {@link JSONArray} h...
[ "Sorts", "the", "children", "of", "root", "by", "the", "the", "sentence", "indizes", ".", "Since", "the", "sentence", "indizes", "are", "based", "on", "the", "token", "indizes", "some", "sentences", "have", "no", "sentences", "indizes", "because", "sometimes",...
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java#L679-L722
99,865
korpling/ANNIS
annis-service/src/main/java/annis/service/internal/AnnisServiceRunner.java
AnnisServiceRunner.shutdown
public void shutdown() { log.info("Shutting down..."); isShutdownRequested = true; try { mainThread.join(); } catch (InterruptedException e) { log.error( "Interrupted which waiting on main daemon thread to complete."); } }
java
public void shutdown() { log.info("Shutting down..."); isShutdownRequested = true; try { mainThread.join(); } catch (InterruptedException e) { log.error( "Interrupted which waiting on main daemon thread to complete."); } }
[ "public", "void", "shutdown", "(", ")", "{", "log", ".", "info", "(", "\"Shutting down...\"", ")", ";", "isShutdownRequested", "=", "true", ";", "try", "{", "mainThread", ".", "join", "(", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{...
shutdown the AnnisService - ensure that current work load finishes
[ "shutdown", "the", "AnnisService", "-", "ensure", "that", "current", "work", "load", "finishes" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/service/internal/AnnisServiceRunner.java#L152-L166
99,866
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
99,867
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
99,868
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
99,869
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
99,870
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
99,871
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
99,872
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
99,873
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
99,874
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
99,875
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
99,876
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
99,877
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
99,878
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
99,879
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
99,880
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
99,881
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
99,882
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
99,883
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
99,884
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
99,885
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
99,886
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
99,887
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
99,888
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
99,889
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
99,890
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
99,891
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
99,892
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
99,893
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
99,894
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
99,895
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
99,896
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
99,897
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
99,898
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
99,899
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