repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java
SearchUtils.findMethod
public static MethodNode findMethod(Collection<MethodNode> methodNodes, boolean isStatic, Type returnType, String name, Type ... paramTypes) { Validate.notNull(methodNodes); Validate.notNull(returnType); Validate.notNull(name); Validate.notNull(paramTypes); Validate.n...
java
public static MethodNode findMethod(Collection<MethodNode> methodNodes, boolean isStatic, Type returnType, String name, Type ... paramTypes) { Validate.notNull(methodNodes); Validate.notNull(returnType); Validate.notNull(name); Validate.notNull(paramTypes); Validate.n...
[ "public", "static", "MethodNode", "findMethod", "(", "Collection", "<", "MethodNode", ">", "methodNodes", ",", "boolean", "isStatic", ",", "Type", "returnType", ",", "String", "name", ",", "Type", "...", "paramTypes", ")", "{", "Validate", ".", "notNull", "(",...
Find a method within a class. @param methodNodes method nodes to search through @param name method name to search for @param isStatic {@code true} if the method should be static @param returnType return type to search for @param paramTypes parameter types to search for (in the order specified) @return method found (or ...
[ "Find", "a", "method", "within", "a", "class", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java#L185-L209
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java
SearchUtils.findInvocationsOf
public static List<AbstractInsnNode> findInvocationsOf(InsnList insnList, Method expectedMethod) { Validate.notNull(insnList); Validate.notNull(expectedMethod); List<AbstractInsnNode> ret = new ArrayList<>(); Type expectedMethodDesc = Type.getType(expectedMethod); Type ...
java
public static List<AbstractInsnNode> findInvocationsOf(InsnList insnList, Method expectedMethod) { Validate.notNull(insnList); Validate.notNull(expectedMethod); List<AbstractInsnNode> ret = new ArrayList<>(); Type expectedMethodDesc = Type.getType(expectedMethod); Type ...
[ "public", "static", "List", "<", "AbstractInsnNode", ">", "findInvocationsOf", "(", "InsnList", "insnList", ",", "Method", "expectedMethod", ")", "{", "Validate", ".", "notNull", "(", "insnList", ")", ";", "Validate", ".", "notNull", "(", "expectedMethod", ")", ...
Find invocations of a certain method. @param insnList instruction list to search through @param expectedMethod type of method being invoked @return list of invocations (may be nodes of type {@link MethodInsnNode} or {@link InvokeDynamicInsnNode}) @throws NullPointerException if any argument is {@code null} @throws Null...
[ "Find", "invocations", "of", "a", "certain", "method", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java#L219-L251
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java
SearchUtils.findInvocationsWithParameter
public static List<AbstractInsnNode> findInvocationsWithParameter(InsnList insnList, Type expectedParamType) { Validate.notNull(insnList); Validate.notNull(expectedParamType); Validate.isTrue(expectedParamType.getSort() != Type.METHOD && expectedParamType.getSort() != Type.VOID); ...
java
public static List<AbstractInsnNode> findInvocationsWithParameter(InsnList insnList, Type expectedParamType) { Validate.notNull(insnList); Validate.notNull(expectedParamType); Validate.isTrue(expectedParamType.getSort() != Type.METHOD && expectedParamType.getSort() != Type.VOID); ...
[ "public", "static", "List", "<", "AbstractInsnNode", ">", "findInvocationsWithParameter", "(", "InsnList", "insnList", ",", "Type", "expectedParamType", ")", "{", "Validate", ".", "notNull", "(", "insnList", ")", ";", "Validate", ".", "notNull", "(", "expectedPara...
Find invocations of any method where the parameter list contains a type. @param insnList instruction list to search through @param expectedParamType parameter type @return list of invocations (may be nodes of type {@link MethodInsnNode} or {@link InvokeDynamicInsnNode}) @throws NullPointerException if any argument is {...
[ "Find", "invocations", "of", "any", "method", "where", "the", "parameter", "list", "contains", "a", "type", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java#L261-L291
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java
SearchUtils.searchForOpcodes
public static List<AbstractInsnNode> searchForOpcodes(InsnList insnList, int ... opcodes) { Validate.notNull(insnList); Validate.notNull(opcodes); Validate.isTrue(opcodes.length > 0); List<AbstractInsnNode> ret = new LinkedList<>(); Set<Integer> opcodeSet = new ...
java
public static List<AbstractInsnNode> searchForOpcodes(InsnList insnList, int ... opcodes) { Validate.notNull(insnList); Validate.notNull(opcodes); Validate.isTrue(opcodes.length > 0); List<AbstractInsnNode> ret = new LinkedList<>(); Set<Integer> opcodeSet = new ...
[ "public", "static", "List", "<", "AbstractInsnNode", ">", "searchForOpcodes", "(", "InsnList", "insnList", ",", "int", "...", "opcodes", ")", "{", "Validate", ".", "notNull", "(", "insnList", ")", ";", "Validate", ".", "notNull", "(", "opcodes", ")", ";", ...
Find instructions in a certain class that are of a certain set of opcodes. @param insnList instruction list to search through @param opcodes opcodes to search for @return list of instructions that contain the opcodes being searched for @throws NullPointerException if any argument is {@code null} @throws IllegalArgument...
[ "Find", "instructions", "in", "a", "certain", "class", "that", "are", "of", "a", "certain", "set", "of", "opcodes", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java#L301-L320
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java
SearchUtils.findLineNumberForInstruction
public static LineNumberNode findLineNumberForInstruction(InsnList insnList, AbstractInsnNode insnNode) { Validate.notNull(insnList); Validate.notNull(insnNode); int idx = insnList.indexOf(insnNode); Validate.isTrue(idx != -1); // Get index of labels and insnNod...
java
public static LineNumberNode findLineNumberForInstruction(InsnList insnList, AbstractInsnNode insnNode) { Validate.notNull(insnList); Validate.notNull(insnNode); int idx = insnList.indexOf(insnNode); Validate.isTrue(idx != -1); // Get index of labels and insnNod...
[ "public", "static", "LineNumberNode", "findLineNumberForInstruction", "(", "InsnList", "insnList", ",", "AbstractInsnNode", "insnNode", ")", "{", "Validate", ".", "notNull", "(", "insnList", ")", ";", "Validate", ".", "notNull", "(", "insnNode", ")", ";", "int", ...
Find line number associated with an instruction. @param insnList instruction list for method @param insnNode instruction within method being searched against @throws NullPointerException if any argument is {@code null} or contains {@code null} @throws IllegalArgumentException if arguments aren't all from the same metho...
[ "Find", "line", "number", "associated", "with", "an", "instruction", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java#L394-L412
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java
SearchUtils.findLocalVariableNodeForInstruction
public static LocalVariableNode findLocalVariableNodeForInstruction(List<LocalVariableNode> lvnList, InsnList insnList, final AbstractInsnNode insnNode, int idx) { Validate.notNull(insnList); Validate.notNull(insnNode); Validate.isTrue(idx >= 0); int insnIdx = insnLi...
java
public static LocalVariableNode findLocalVariableNodeForInstruction(List<LocalVariableNode> lvnList, InsnList insnList, final AbstractInsnNode insnNode, int idx) { Validate.notNull(insnList); Validate.notNull(insnNode); Validate.isTrue(idx >= 0); int insnIdx = insnLi...
[ "public", "static", "LocalVariableNode", "findLocalVariableNodeForInstruction", "(", "List", "<", "LocalVariableNode", ">", "lvnList", ",", "InsnList", "insnList", ",", "final", "AbstractInsnNode", "insnNode", ",", "int", "idx", ")", "{", "Validate", ".", "notNull", ...
Find local variable node for a local variable at some instruction. @param lvnList list of local variable nodes for method @param insnList instruction list for method @param insnNode instruction within method being searched against @param idx local variable table index, or {@code null} if no local variable nodes are spe...
[ "Find", "local", "variable", "node", "for", "a", "local", "variable", "at", "some", "instruction", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java#L425-L530
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java
SearchUtils.findField
public static FieldNode findField(ClassNode classNode, String name) { Validate.notNull(classNode); Validate.notNull(name); Validate.notEmpty(name); return classNode.fields.stream() .filter(x -> name.equals(x.name)) .findAny().orElse(null); }
java
public static FieldNode findField(ClassNode classNode, String name) { Validate.notNull(classNode); Validate.notNull(name); Validate.notEmpty(name); return classNode.fields.stream() .filter(x -> name.equals(x.name)) .findAny().orElse(null); }
[ "public", "static", "FieldNode", "findField", "(", "ClassNode", "classNode", ",", "String", "name", ")", "{", "Validate", ".", "notNull", "(", "classNode", ")", ";", "Validate", ".", "notNull", "(", "name", ")", ";", "Validate", ".", "notEmpty", "(", "name...
Find field within a class by its name. @param classNode class to search @param name name to search for @return found field (or {@code null} if not found) @throws NullPointerException if any argument is {@code null} @throws IllegalArgumentException if {@code name} is empty
[ "Find", "field", "within", "a", "class", "by", "its", "name", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java#L540-L547
train
jtmelton/appsensor
appsensor-core/src/main/java/org/owasp/appsensor/core/util/XmlUtils.java
XmlUtils.validateXMLSchema
public static void validateXMLSchema(String xsdPath, String xmlPath) throws IOException, SAXException { InputStream xsdStream = null; InputStream xmlStream = null; try { xsdStream = XmlUtils.class.getResourceAsStream(xsdPath); //try loading from classpath first - fallback to disk if (xsdStream == null...
java
public static void validateXMLSchema(String xsdPath, String xmlPath) throws IOException, SAXException { InputStream xsdStream = null; InputStream xmlStream = null; try { xsdStream = XmlUtils.class.getResourceAsStream(xsdPath); //try loading from classpath first - fallback to disk if (xsdStream == null...
[ "public", "static", "void", "validateXMLSchema", "(", "String", "xsdPath", ",", "String", "xmlPath", ")", "throws", "IOException", ",", "SAXException", "{", "InputStream", "xsdStream", "=", "null", ";", "InputStream", "xmlStream", "=", "null", ";", "try", "{", ...
Validate XML matches XSD. Path-based method. Simple redirect to the overloaded version that accepts streams. @param xsdPath resource based path to XSD file @param xmlPath resource based path to XML file @throws IOException io exception for loading files @throws SAXException sax exception for parsing files
[ "Validate", "XML", "matches", "XSD", ".", "Path", "-", "based", "method", ".", "Simple", "redirect", "to", "the", "overloaded", "version", "that", "accepts", "streams", "." ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/appsensor-core/src/main/java/org/owasp/appsensor/core/util/XmlUtils.java#L35-L73
train
jtmelton/appsensor
appsensor-core/src/main/java/org/owasp/appsensor/core/util/XmlUtils.java
XmlUtils.validateXMLSchema
public static void validateXMLSchema(InputStream xsdStream, InputStream xmlStream) throws IOException, SAXException { SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = factory.newSchema(new StreamSource(xsdStream)); Validator validator = schem...
java
public static void validateXMLSchema(InputStream xsdStream, InputStream xmlStream) throws IOException, SAXException { SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = factory.newSchema(new StreamSource(xsdStream)); Validator validator = schem...
[ "public", "static", "void", "validateXMLSchema", "(", "InputStream", "xsdStream", ",", "InputStream", "xmlStream", ")", "throws", "IOException", ",", "SAXException", "{", "SchemaFactory", "factory", "=", "SchemaFactory", ".", "newInstance", "(", "XMLConstants", ".", ...
Validate XML matches XSD. Stream-based method. @param xsdStream resource based path to XSD file @param xmlStream resource based path to XML file @throws IOException io exception for loading files @throws SAXException sax exception for parsing files
[ "Validate", "XML", "matches", "XSD", ".", "Stream", "-", "based", "method", "." ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/appsensor-core/src/main/java/org/owasp/appsensor/core/util/XmlUtils.java#L83-L88
train
jtmelton/appsensor
appsensor-core/src/main/java/org/owasp/appsensor/core/util/XmlUtils.java
XmlUtils.getElementQualifiedName
public static String getElementQualifiedName(XMLStreamReader xmlReader, Map<String, String> namespaces) { String namespaceUri = null; String localName = null; switch(xmlReader.getEventType()) { case XMLStreamConstants.START_ELEMENT: case XMLStreamConstants.END_ELEMENT: namespaceUri = xmlReader.getNam...
java
public static String getElementQualifiedName(XMLStreamReader xmlReader, Map<String, String> namespaces) { String namespaceUri = null; String localName = null; switch(xmlReader.getEventType()) { case XMLStreamConstants.START_ELEMENT: case XMLStreamConstants.END_ELEMENT: namespaceUri = xmlReader.getNam...
[ "public", "static", "String", "getElementQualifiedName", "(", "XMLStreamReader", "xmlReader", ",", "Map", "<", "String", ",", "String", ">", "namespaces", ")", "{", "String", "namespaceUri", "=", "null", ";", "String", "localName", "=", "null", ";", "switch", ...
Helper method for getting qualified name from stax reader given a set of specified schema namespaces @param xmlReader stax reader @param namespaces specified schema namespaces @return qualified element name
[ "Helper", "method", "for", "getting", "qualified", "name", "from", "stax", "reader", "given", "a", "set", "of", "specified", "schema", "namespaces" ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/appsensor-core/src/main/java/org/owasp/appsensor/core/util/XmlUtils.java#L97-L113
train
jtmelton/appsensor
appsensor-core/src/main/java/org/owasp/appsensor/core/util/DateUtils.java
DateUtils.fromString
public static DateTime fromString(String rfc3339Timestamp) { if (rfc3339Timestamp == null) { return null; } DateTime dateTime = new DateTime(rfc3339Timestamp, DateTimeZone.UTC); return dateTime; }
java
public static DateTime fromString(String rfc3339Timestamp) { if (rfc3339Timestamp == null) { return null; } DateTime dateTime = new DateTime(rfc3339Timestamp, DateTimeZone.UTC); return dateTime; }
[ "public", "static", "DateTime", "fromString", "(", "String", "rfc3339Timestamp", ")", "{", "if", "(", "rfc3339Timestamp", "==", "null", ")", "{", "return", "null", ";", "}", "DateTime", "dateTime", "=", "new", "DateTime", "(", "rfc3339Timestamp", ",", "DateTim...
Helper for parsing rfc3339 compliant timestamp from string @param rfc3339Timestamp timestamp as string in rfc3339 format @return {@link DateTime} representing rfc3339 compliant timestamp from parameter
[ "Helper", "for", "parsing", "rfc3339", "compliant", "timestamp", "from", "string" ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/appsensor-core/src/main/java/org/owasp/appsensor/core/util/DateUtils.java#L36-L43
train
jtmelton/appsensor
configuration-modes/appsensor-configuration-stax/src/main/java/org/owasp/appsensor/configuration/stax/server/StaxServerConfiguration.java
StaxServerConfiguration.loadConfiguration
private ServerConfiguration loadConfiguration(ServerConfigurationReader configurationReader) throws ConfigurationException { ServerConfiguration configuration = configurationReader.read(); return configuration; }
java
private ServerConfiguration loadConfiguration(ServerConfigurationReader configurationReader) throws ConfigurationException { ServerConfiguration configuration = configurationReader.read(); return configuration; }
[ "private", "ServerConfiguration", "loadConfiguration", "(", "ServerConfigurationReader", "configurationReader", ")", "throws", "ConfigurationException", "{", "ServerConfiguration", "configuration", "=", "configurationReader", ".", "read", "(", ")", ";", "return", "configurati...
Bootstrap mechanism that loads the configuration for the server object based on the specified configuration reading mechanism. The reference implementation of the configuration is XML-based, but this interface allows for whatever mechanism is desired @param configurationReader desired configuration reader
[ "Bootstrap", "mechanism", "that", "loads", "the", "configuration", "for", "the", "server", "object", "based", "on", "the", "specified", "configuration", "reading", "mechanism", "." ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/configuration-modes/appsensor-configuration-stax/src/main/java/org/owasp/appsensor/configuration/stax/server/StaxServerConfiguration.java#L62-L66
train
jtmelton/appsensor
appsensor-core/src/main/java/org/owasp/appsensor/core/configuration/server/ServerConfiguration.java
ServerConfiguration.getRelatedDetectionSystems
public Collection<String> getRelatedDetectionSystems(DetectionSystem detectionSystem) { Collection<String> relatedDetectionSystems = new HashSet<String>(); relatedDetectionSystems.add(detectionSystem.getDetectionSystemId()); if(correlationSets != null) { for(CorrelationSet correlationSet : correlationSets) {...
java
public Collection<String> getRelatedDetectionSystems(DetectionSystem detectionSystem) { Collection<String> relatedDetectionSystems = new HashSet<String>(); relatedDetectionSystems.add(detectionSystem.getDetectionSystemId()); if(correlationSets != null) { for(CorrelationSet correlationSet : correlationSets) {...
[ "public", "Collection", "<", "String", ">", "getRelatedDetectionSystems", "(", "DetectionSystem", "detectionSystem", ")", "{", "Collection", "<", "String", ">", "relatedDetectionSystems", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "relatedDetectionSys...
Find related detection systems based on a given detection system. This simply means those systems that have been configured along with the specified system id as part of a correlation set. @param detectionSystemId system ID to evaluate and find correlated systems @return collection of strings representing correlation ...
[ "Find", "related", "detection", "systems", "based", "on", "a", "given", "detection", "system", ".", "This", "simply", "means", "those", "systems", "that", "have", "been", "configured", "along", "with", "the", "specified", "system", "id", "as", "part", "of", ...
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/appsensor-core/src/main/java/org/owasp/appsensor/core/configuration/server/ServerConfiguration.java#L187-L203
train
jtmelton/appsensor
execution-modes/appsensor-kafka-server/src/main/java/org/owasp/appsensor/kafka/KafkaRequestHandler.java
KafkaRequestHandler.buildTopicNames
private Collection<String> buildTopicNames(Response response) { Collection<String> topicNames = new HashSet<>(); Collection<String> detectionSystemNames = appSensorServer.getConfiguration().getRelatedDetectionSystems(response.getDetectionSystem()); for(String detectionSystemName : detectionSystemNames) { ...
java
private Collection<String> buildTopicNames(Response response) { Collection<String> topicNames = new HashSet<>(); Collection<String> detectionSystemNames = appSensorServer.getConfiguration().getRelatedDetectionSystems(response.getDetectionSystem()); for(String detectionSystemName : detectionSystemNames) { ...
[ "private", "Collection", "<", "String", ">", "buildTopicNames", "(", "Response", "response", ")", "{", "Collection", "<", "String", ">", "topicNames", "=", "new", "HashSet", "<>", "(", ")", ";", "Collection", "<", "String", ">", "detectionSystemNames", "=", ...
build the appropriate topic names to send this response to based on related detection systems
[ "build", "the", "appropriate", "topic", "names", "to", "send", "this", "response", "to", "based", "on", "related", "detection", "systems" ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/execution-modes/appsensor-kafka-server/src/main/java/org/owasp/appsensor/kafka/KafkaRequestHandler.java#L377-L387
train
jtmelton/appsensor
analysis-engines/appsensor-analysis-reference/src/main/java/org/owasp/appsensor/analysis/ReferenceResponseAnalysisEngine.java
ReferenceResponseAnalysisEngine.analyze
@Override public void analyze(Response response) { if (response != null) { logger.info("NO-OP Response for user <" + response.getUser().getUsername() + "> - should be executing response action " + response.getAction()); } }
java
@Override public void analyze(Response response) { if (response != null) { logger.info("NO-OP Response for user <" + response.getUser().getUsername() + "> - should be executing response action " + response.getAction()); } }
[ "@", "Override", "public", "void", "analyze", "(", "Response", "response", ")", "{", "if", "(", "response", "!=", "null", ")", "{", "logger", ".", "info", "(", "\"NO-OP Response for user <\"", "+", "response", ".", "getUser", "(", ")", ".", "getUsername", ...
This method simply logs responses. @param response {@link Response} that has been added to the {@link ResponseStore}.
[ "This", "method", "simply", "logs", "responses", "." ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/analysis-engines/appsensor-analysis-reference/src/main/java/org/owasp/appsensor/analysis/ReferenceResponseAnalysisEngine.java#L32-L37
train
jtmelton/appsensor
appsensor-core/src/main/java/org/owasp/appsensor/core/storage/ResponseStore.java
ResponseStore.findResponses
public Collection<Response> findResponses(SearchCriteria criteria, Collection<Response> responses) { if (criteria == null) { throw new IllegalArgumentException("criteria must be non-null"); } Collection<Response> matches = new ArrayList<Response>(); User user = criteria.getUser(); Collection<String> ...
java
public Collection<Response> findResponses(SearchCriteria criteria, Collection<Response> responses) { if (criteria == null) { throw new IllegalArgumentException("criteria must be non-null"); } Collection<Response> matches = new ArrayList<Response>(); User user = criteria.getUser(); Collection<String> ...
[ "public", "Collection", "<", "Response", ">", "findResponses", "(", "SearchCriteria", "criteria", ",", "Collection", "<", "Response", ">", "responses", ")", "{", "if", "(", "criteria", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\...
Finder for responses in the ResponseStore @param criteria the {@link org.owasp.appsensor.core.criteria.SearchCriteria} object to search by @return a {@link java.util.Collection} of {@link org.owasp.appsensor.core.Response} objects matching the search criteria.
[ "Finder", "for", "responses", "in", "the", "ResponseStore" ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/appsensor-core/src/main/java/org/owasp/appsensor/core/storage/ResponseStore.java#L52-L83
train
jtmelton/appsensor
configuration-modes/appsensor-configuration-stax/src/main/java/org/owasp/appsensor/configuration/stax/client/StaxClientConfiguration.java
StaxClientConfiguration.loadConfiguration
private ClientConfiguration loadConfiguration(ClientConfigurationReader configurationReader) throws ConfigurationException { ClientConfiguration configuration = configurationReader.read(); return configuration; }
java
private ClientConfiguration loadConfiguration(ClientConfigurationReader configurationReader) throws ConfigurationException { ClientConfiguration configuration = configurationReader.read(); return configuration; }
[ "private", "ClientConfiguration", "loadConfiguration", "(", "ClientConfigurationReader", "configurationReader", ")", "throws", "ConfigurationException", "{", "ClientConfiguration", "configuration", "=", "configurationReader", ".", "read", "(", ")", ";", "return", "configurati...
Bootstrap mechanism that loads the configuration for the client object based on the specified configuration reading mechanism. The reference implementation of the configuration is XML-based, but this interface allows for whatever mechanism is desired @param configurationReader desired configuration reader
[ "Bootstrap", "mechanism", "that", "loads", "the", "configuration", "for", "the", "client", "object", "based", "on", "the", "specified", "configuration", "reading", "mechanism", "." ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/configuration-modes/appsensor-configuration-stax/src/main/java/org/owasp/appsensor/configuration/stax/client/StaxClientConfiguration.java#L62-L66
train
jtmelton/appsensor
execution-modes/appsensor-amqp-rabbitmq-server/src/main/java/org/owasp/appsensor/amqp/rabbitmq/RabbitMqRequestHandler.java
RabbitMqRequestHandler.buildQueueNames
private Collection<String> buildQueueNames(Response response) { Collection<String> queueNames = new HashSet<>(); Collection<String> detectionSystemNames = appSensorServer.getConfiguration().getRelatedDetectionSystems(response.getDetectionSystem()); for(String detectionSystemName : detectionSystemNames) { ...
java
private Collection<String> buildQueueNames(Response response) { Collection<String> queueNames = new HashSet<>(); Collection<String> detectionSystemNames = appSensorServer.getConfiguration().getRelatedDetectionSystems(response.getDetectionSystem()); for(String detectionSystemName : detectionSystemNames) { ...
[ "private", "Collection", "<", "String", ">", "buildQueueNames", "(", "Response", "response", ")", "{", "Collection", "<", "String", ">", "queueNames", "=", "new", "HashSet", "<>", "(", ")", ";", "Collection", "<", "String", ">", "detectionSystemNames", "=", ...
build the appropriate queues to send this response to based on related detection systems
[ "build", "the", "appropriate", "queues", "to", "send", "this", "response", "to", "based", "on", "related", "detection", "systems" ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/execution-modes/appsensor-amqp-rabbitmq-server/src/main/java/org/owasp/appsensor/amqp/rabbitmq/RabbitMqRequestHandler.java#L254-L264
train
jtmelton/appsensor
integrations/appsensor-integration-cef-syslog/src/main/java/org/owasp/appsensor/integration/cef/syslog/CefSyslogEmitter.java
CefSyslogEmitter.encodeCEFHeader
protected String encodeCEFHeader(String text) { String encoded = text; // back-slash encode back-slashes (needs to be first) encoded = encoded.replace("\\","\\\\"); // back-slash encode pipes encoded = encoded.replace("|","\\|"); // strip carriage returns and newlines encoded = encoded.replace("\...
java
protected String encodeCEFHeader(String text) { String encoded = text; // back-slash encode back-slashes (needs to be first) encoded = encoded.replace("\\","\\\\"); // back-slash encode pipes encoded = encoded.replace("|","\\|"); // strip carriage returns and newlines encoded = encoded.replace("\...
[ "protected", "String", "encodeCEFHeader", "(", "String", "text", ")", "{", "String", "encoded", "=", "text", ";", "// back-slash encode back-slashes (needs to be first)", "encoded", "=", "encoded", ".", "replace", "(", "\"\\\\\"", ",", "\"\\\\\\\\\"", ")", ";", "// ...
header needs to encode '|', '\' '\r', '\n'
[ "header", "needs", "to", "encode", "|", "\\", "\\", "r", "\\", "n" ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/integrations/appsensor-integration-cef-syslog/src/main/java/org/owasp/appsensor/integration/cef/syslog/CefSyslogEmitter.java#L376-L390
train
jtmelton/appsensor
integrations/appsensor-integration-cef-syslog/src/main/java/org/owasp/appsensor/integration/cef/syslog/CefSyslogEmitter.java
CefSyslogEmitter.encodeCEFExtension
protected String encodeCEFExtension(String text) { String encoded = text; // back-slash encode back-slashes (needs to be first) encoded = encoded.replace("\\","\\\\"); // back-slash encode equals signs encoded = encoded.replace("=","\\="); // strip carriage returns and newlines encoded = encoded....
java
protected String encodeCEFExtension(String text) { String encoded = text; // back-slash encode back-slashes (needs to be first) encoded = encoded.replace("\\","\\\\"); // back-slash encode equals signs encoded = encoded.replace("=","\\="); // strip carriage returns and newlines encoded = encoded....
[ "protected", "String", "encodeCEFExtension", "(", "String", "text", ")", "{", "String", "encoded", "=", "text", ";", "// back-slash encode back-slashes (needs to be first)", "encoded", "=", "encoded", ".", "replace", "(", "\"\\\\\"", ",", "\"\\\\\\\\\"", ")", ";", "...
extension needs to encode '\', '=' '\r', '\n'
[ "extension", "needs", "to", "encode", "\\", "=", "\\", "r", "\\", "n" ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/integrations/appsensor-integration-cef-syslog/src/main/java/org/owasp/appsensor/integration/cef/syslog/CefSyslogEmitter.java#L394-L408
train
jtmelton/appsensor
execution-modes/appsensor-local/src/main/java/org/owasp/appsensor/local/analysis/LocalResponseAnalysisEngine.java
LocalResponseAnalysisEngine.analyze
@Override public void analyze(Response response) { if(response == null) { return; } if (ResponseHandler.LOG.equals(response.getAction())) { logger.info("Handling <log> response for user <{}>", response.getUser().getUsername()); } else { logger.info("Delegating response for user <{}> to configured r...
java
@Override public void analyze(Response response) { if(response == null) { return; } if (ResponseHandler.LOG.equals(response.getAction())) { logger.info("Handling <log> response for user <{}>", response.getUser().getUsername()); } else { logger.info("Delegating response for user <{}> to configured r...
[ "@", "Override", "public", "void", "analyze", "(", "Response", "response", ")", "{", "if", "(", "response", "==", "null", ")", "{", "return", ";", "}", "if", "(", "ResponseHandler", ".", "LOG", ".", "equals", "(", "response", ".", "getAction", "(", ")"...
This method simply logs or executes responses. @param response {@link Response} that has been added to the {@link ResponseStore}.
[ "This", "method", "simply", "logs", "or", "executes", "responses", "." ]
c3b4e9ada50fdee974e0d618ec4bdfabc2163798
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/execution-modes/appsensor-local/src/main/java/org/owasp/appsensor/local/analysis/LocalResponseAnalysisEngine.java#L40-L54
train
relops/snowflake
src/main/java/com/relops/snowflake/Snowflake.java
Snowflake.next
public long next() { long currentTime = System.currentTimeMillis(); long counter; synchronized(this) { if (currentTime < referenceTime) { throw new RuntimeException(String.format("Last referenceTime %s is after reference time %s", referenceTime, currentTime)); } else if (currentTime >...
java
public long next() { long currentTime = System.currentTimeMillis(); long counter; synchronized(this) { if (currentTime < referenceTime) { throw new RuntimeException(String.format("Last referenceTime %s is after reference time %s", referenceTime, currentTime)); } else if (currentTime >...
[ "public", "long", "next", "(", ")", "{", "long", "currentTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "counter", ";", "synchronized", "(", "this", ")", "{", "if", "(", "currentTime", "<", "referenceTime", ")", "{", "throw", "new...
Generates a k-ordered unique 64-bit integer. Subsequent invocations of this method will produce increasing integer values. @return The next 64-bit integer.
[ "Generates", "a", "k", "-", "ordered", "unique", "64", "-", "bit", "integer", ".", "Subsequent", "invocations", "of", "this", "method", "will", "produce", "increasing", "integer", "values", "." ]
a99cf2e65e8138791c38a8ddda1a379e2ec3eb0f
https://github.com/relops/snowflake/blob/a99cf2e65e8138791c38a8ddda1a379e2ec3eb0f/src/main/java/com/relops/snowflake/Snowflake.java#L39-L62
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java
HeidelTime.addTimexAnnotation
public void addTimexAnnotation(String timexType, int begin, int end, Sentence sentence, String timexValue, String timexQuant, String timexFreq, String timexMod, String emptyValue, String timexId, String foundByRule, JCas jcas) { Timex3 annotation = new Timex3(jcas); annotation.setBegin(begin); annotation.se...
java
public void addTimexAnnotation(String timexType, int begin, int end, Sentence sentence, String timexValue, String timexQuant, String timexFreq, String timexMod, String emptyValue, String timexId, String foundByRule, JCas jcas) { Timex3 annotation = new Timex3(jcas); annotation.setBegin(begin); annotation.se...
[ "public", "void", "addTimexAnnotation", "(", "String", "timexType", ",", "int", "begin", ",", "int", "end", ",", "Sentence", "sentence", ",", "String", "timexValue", ",", "String", "timexQuant", ",", "String", "timexFreq", ",", "String", "timexMod", ",", "Stri...
Add timex annotation to CAS object. @param timexType @param begin @param end @param timexValue @param timexId @param foundByRule @param jcas
[ "Add", "timex", "annotation", "to", "CAS", "object", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java#L338-L389
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java
HeidelTime.specifyAmbiguousValues
public void specifyAmbiguousValues(JCas jcas) { // build up a list with all found TIMEX expressions List<Timex3> linearDates = new ArrayList<Timex3>(); FSIterator iterTimex = jcas.getAnnotationIndex(Timex3.type).iterator(); // Create List of all Timexes of types "date" and "time" while (iterTimex.hasNext()) ...
java
public void specifyAmbiguousValues(JCas jcas) { // build up a list with all found TIMEX expressions List<Timex3> linearDates = new ArrayList<Timex3>(); FSIterator iterTimex = jcas.getAnnotationIndex(Timex3.type).iterator(); // Create List of all Timexes of types "date" and "time" while (iterTimex.hasNext()) ...
[ "public", "void", "specifyAmbiguousValues", "(", "JCas", "jcas", ")", "{", "// build up a list with all found TIMEX expressions", "List", "<", "Timex3", ">", "linearDates", "=", "new", "ArrayList", "<", "Timex3", ">", "(", ")", ";", "FSIterator", "iterTimex", "=", ...
Under-specified values are disambiguated here. Only Timexes of types "date" and "time" can be under-specified. @param jcas
[ "Under", "-", "specified", "values", "are", "disambiguated", "here", ".", "Only", "Timexes", "of", "types", "date", "and", "time", "can", "be", "under", "-", "specified", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java#L1870-L1912
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java
HeidelTime.checkPosConstraint
public boolean checkPosConstraint(Sentence s, String posConstraint, MatchResult m, JCas jcas) { Pattern paConstraint = Pattern.compile("group\\(([0-9]+)\\):(.*?):"); for (MatchResult mr : Toolbox.findMatches(paConstraint,posConstraint)) { int groupNumber = Integer.parseInt(mr.group(1)); int tokenBegin = s.get...
java
public boolean checkPosConstraint(Sentence s, String posConstraint, MatchResult m, JCas jcas) { Pattern paConstraint = Pattern.compile("group\\(([0-9]+)\\):(.*?):"); for (MatchResult mr : Toolbox.findMatches(paConstraint,posConstraint)) { int groupNumber = Integer.parseInt(mr.group(1)); int tokenBegin = s.get...
[ "public", "boolean", "checkPosConstraint", "(", "Sentence", "s", ",", "String", "posConstraint", ",", "MatchResult", "m", ",", "JCas", "jcas", ")", "{", "Pattern", "paConstraint", "=", "Pattern", ".", "compile", "(", "\"group\\\\(([0-9]+)\\\\):(.*?):\"", ")", ";",...
Check whether the part of speech constraint defined in a rule is satisfied. @param s @param posConstraint @param m @param jcas @return
[ "Check", "whether", "the", "part", "of", "speech", "constraint", "defined", "in", "a", "rule", "is", "satisfied", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java#L2297-L2312
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java
HeidelTime.isValidDCT
private Boolean isValidDCT(JCas jcas) { FSIterator dctIter = jcas.getAnnotationIndex(Dct.type).iterator(); if(!dctIter.hasNext()) { return true; } else { Dct dct = (Dct) dctIter.next(); String dctVal = dct.getValue(); if(dctVal == null) return false; if(dctVal.matches("\\d{8}") // So...
java
private Boolean isValidDCT(JCas jcas) { FSIterator dctIter = jcas.getAnnotationIndex(Dct.type).iterator(); if(!dctIter.hasNext()) { return true; } else { Dct dct = (Dct) dctIter.next(); String dctVal = dct.getValue(); if(dctVal == null) return false; if(dctVal.matches("\\d{8}") // So...
[ "private", "Boolean", "isValidDCT", "(", "JCas", "jcas", ")", "{", "FSIterator", "dctIter", "=", "jcas", ".", "getAnnotationIndex", "(", "Dct", ".", "type", ")", ".", "iterator", "(", ")", ";", "if", "(", "!", "dctIter", ".", "hasNext", "(", ")", ")", ...
Check whether or not a jcas object has a correct DCT value. If there is no DCT present, we canonically return true since fallback calculation takes care of that scenario. @param jcas @return Whether or not the given jcas contains a valid DCT
[ "Check", "whether", "or", "not", "a", "jcas", "object", "has", "a", "correct", "DCT", "value", ".", "If", "there", "is", "no", "DCT", "present", "we", "canonically", "return", "true", "since", "fallback", "calculation", "takes", "care", "of", "that", "scen...
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/HeidelTime.java#L2546-L2565
train
HeidelTime/heideltime
src/jflexcrf/FeatureGen.java
FeatureGen.startScanSFeaturesAt
void startScanSFeaturesAt(List seq, int pos) { sFeatures.clear(); sFeatureIdx = 0; Observation obsr = (Observation)seq.get(pos); // scan over all context predicates for (int i = 0; i < obsr.cps.length; i++) { Element elem = (Element)dict.dict.get(new Integer(obsr.cps[i])); if (elem == null) { ...
java
void startScanSFeaturesAt(List seq, int pos) { sFeatures.clear(); sFeatureIdx = 0; Observation obsr = (Observation)seq.get(pos); // scan over all context predicates for (int i = 0; i < obsr.cps.length; i++) { Element elem = (Element)dict.dict.get(new Integer(obsr.cps[i])); if (elem == null) { ...
[ "void", "startScanSFeaturesAt", "(", "List", "seq", ",", "int", "pos", ")", "{", "sFeatures", ".", "clear", "(", ")", ";", "sFeatureIdx", "=", "0", ";", "Observation", "obsr", "=", "(", "Observation", ")", "seq", ".", "get", "(", "pos", ")", ";", "//...
Start scan s features at. @param seq the seq @param pos the pos
[ "Start", "scan", "s", "features", "at", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jflexcrf/FeatureGen.java#L227-L263
train
HeidelTime/heideltime
src/jflexcrf/FeatureGen.java
FeatureGen.nextSFeature
Feature nextSFeature() { Feature sF = (Feature)sFeatures.get(sFeatureIdx); sFeatureIdx++; return sF; }
java
Feature nextSFeature() { Feature sF = (Feature)sFeatures.get(sFeatureIdx); sFeatureIdx++; return sF; }
[ "Feature", "nextSFeature", "(", ")", "{", "Feature", "sF", "=", "(", "Feature", ")", "sFeatures", ".", "get", "(", "sFeatureIdx", ")", ";", "sFeatureIdx", "++", ";", "return", "sF", ";", "}" ]
Next s feature. @return the feature
[ "Next", "s", "feature", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jflexcrf/FeatureGen.java#L279-L283
train
HeidelTime/heideltime
src/jflexcrf/FeatureGen.java
FeatureGen.nextEFeature
Feature nextEFeature() { Feature eF = (Feature)eFeatures.get(eFeatureIdx); eFeatureIdx++; return eF; }
java
Feature nextEFeature() { Feature eF = (Feature)eFeatures.get(eFeatureIdx); eFeatureIdx++; return eF; }
[ "Feature", "nextEFeature", "(", ")", "{", "Feature", "eF", "=", "(", "Feature", ")", "eFeatures", ".", "get", "(", "eFeatureIdx", ")", ";", "eFeatureIdx", "++", ";", "return", "eF", ";", "}" ]
Next e feature. @return the feature
[ "Next", "e", "feature", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jflexcrf/FeatureGen.java#L313-L317
train
HeidelTime/heideltime
src/jmaxent/Model.java
Model.updateFeatures
public void updateFeatures() { for (int i = 0; i < feaGen.features.size(); i++) { Feature f = (Feature)feaGen.features.get(i); f.wgt = lambda[f.idx]; } }
java
public void updateFeatures() { for (int i = 0; i < feaGen.features.size(); i++) { Feature f = (Feature)feaGen.features.get(i); f.wgt = lambda[f.idx]; } }
[ "public", "void", "updateFeatures", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "feaGen", ".", "features", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Feature", "f", "=", "(", "Feature", ")", "feaGen", ".", "features", ...
Update features.
[ "Update", "features", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jmaxent/Model.java#L129-L134
train
HeidelTime/heideltime
src/jmaxent/Model.java
Model.initInference
public void initInference() { if (lambda == null) { System.out.println("numFetures: " + feaGen.numFeatures()); lambda = new double[feaGen.numFeatures() + 1]; // reading feature weights from the feature list for (int i = 0; i < feaGen.features.size(); i++) { Feature f = (Feature)feaGen.featu...
java
public void initInference() { if (lambda == null) { System.out.println("numFetures: " + feaGen.numFeatures()); lambda = new double[feaGen.numFeatures() + 1]; // reading feature weights from the feature list for (int i = 0; i < feaGen.features.size(); i++) { Feature f = (Feature)feaGen.featu...
[ "public", "void", "initInference", "(", ")", "{", "if", "(", "lambda", "==", "null", ")", "{", "System", ".", "out", ".", "println", "(", "\"numFetures: \"", "+", "feaGen", ".", "numFeatures", "(", ")", ")", ";", "lambda", "=", "new", "double", "[", ...
Inits the inference.
[ "Inits", "the", "inference", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jmaxent/Model.java#L139-L151
train
HeidelTime/heideltime
src/jflexcrf/DoubleVector.java
DoubleVector.compMult
public void compMult(DoubleVector dv) { for (int i = 0; i < len; i++) { vect[i] *= dv.vect[i]; } }
java
public void compMult(DoubleVector dv) { for (int i = 0; i < len; i++) { vect[i] *= dv.vect[i]; } }
[ "public", "void", "compMult", "(", "DoubleVector", "dv", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "vect", "[", "i", "]", "*=", "dv", ".", "vect", "[", "i", "]", ";", "}", "}" ]
Comp mult. @param dv the dv
[ "Comp", "mult", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jflexcrf/DoubleVector.java#L146-L150
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.findFirstOf
public static int findFirstOf (String container, String chars, int begin){ int minIdx = -1; for (int i = 0; i < chars.length() && i >= 0; ++i){ int idx = container.indexOf(chars.charAt(i), begin); if ( (idx < minIdx && idx != -1) || minIdx == -1){ ...
java
public static int findFirstOf (String container, String chars, int begin){ int minIdx = -1; for (int i = 0; i < chars.length() && i >= 0; ++i){ int idx = container.indexOf(chars.charAt(i), begin); if ( (idx < minIdx && idx != -1) || minIdx == -1){ ...
[ "public", "static", "int", "findFirstOf", "(", "String", "container", ",", "String", "chars", ",", "int", "begin", ")", "{", "int", "minIdx", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "chars", ".", "length", "(", ")", "...
Find the first occurrence . @param container the string on which we search @param chars the string which we search for the occurrence @param begin the start position to search from @return the position where chars first occur in the container
[ "Find", "the", "first", "occurrence", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L50-L59
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.findLastOf
public static int findLastOf (String container, String charSeq, int begin){ //find the last occurrence of one of characters in charSeq from begin backward for (int i = begin; i < container.length() && i >= 0; --i){ if (charSeq.contains("" + container.charAt(i))) return ...
java
public static int findLastOf (String container, String charSeq, int begin){ //find the last occurrence of one of characters in charSeq from begin backward for (int i = begin; i < container.length() && i >= 0; --i){ if (charSeq.contains("" + container.charAt(i))) return ...
[ "public", "static", "int", "findLastOf", "(", "String", "container", ",", "String", "charSeq", ",", "int", "begin", ")", "{", "//find the last occurrence of one of characters in charSeq from begin backward\r", "for", "(", "int", "i", "=", "begin", ";", "i", "<", "co...
Find the last occurrence. @param container the string on which we search @param charSeq the string which we search for the occurrence @param begin the start position in container to search from @return the position where charSeq occurs for the last time in container (from right to left).
[ "Find", "the", "last", "occurrence", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L69-L76
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.findFirstNotOf
public static int findFirstNotOf(String container, String chars, int begin){ //find the first occurrence of characters not in the charSeq from begin forward for (int i = begin; i < container.length() && i >=0; ++i) if (!chars.contains("" + container.charAt(i))) return i; return -1; }
java
public static int findFirstNotOf(String container, String chars, int begin){ //find the first occurrence of characters not in the charSeq from begin forward for (int i = begin; i < container.length() && i >=0; ++i) if (!chars.contains("" + container.charAt(i))) return i; return -1; }
[ "public", "static", "int", "findFirstNotOf", "(", "String", "container", ",", "String", "chars", ",", "int", "begin", ")", "{", "//find the first occurrence of characters not in the charSeq\tfrom begin forward\t\r", "for", "(", "int", "i", "=", "begin", ";", "i", "<",...
Find the first occurrence of characters not in the charSeq from begin @param container the container @param chars the chars @param begin the begin @return the int
[ "Find", "the", "first", "occurrence", "of", "characters", "not", "in", "the", "charSeq", "from", "begin" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L86-L92
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.findLastNotOf
public static int findLastNotOf(String container, String charSeq, int end){ for (int i = end; i < container.length() && i >= 0; --i){ if (!charSeq.contains("" + container.charAt(i))) return i; } return -1; }
java
public static int findLastNotOf(String container, String charSeq, int end){ for (int i = end; i < container.length() && i >= 0; --i){ if (!charSeq.contains("" + container.charAt(i))) return i; } return -1; }
[ "public", "static", "int", "findLastNotOf", "(", "String", "container", ",", "String", "charSeq", ",", "int", "end", ")", "{", "for", "(", "int", "i", "=", "end", ";", "i", "<", "container", ".", "length", "(", ")", "&&", "i", ">=", "0", ";", "--",...
Find last not of. @param container the container @param charSeq the char seq @param end the end @return the int
[ "Find", "last", "not", "of", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L102-L108
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.containNumber
public static boolean containNumber(String str) { for (int i = 0; i < str.length(); i++) { if (Character.isDigit(str.charAt(i))) { return true; } } return false; }
java
public static boolean containNumber(String str) { for (int i = 0; i < str.length(); i++) { if (Character.isDigit(str.charAt(i))) { return true; } } return false; }
[ "public", "static", "boolean", "containNumber", "(", "String", "str", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "str", ".", "length", "(", ")", ";", "i", "++", ")", "{", "if", "(", "Character", ".", "isDigit", "(", "str", ".", ...
Contain number. @param str the str @return true, if successful
[ "Contain", "number", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L117-L124
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.isAllNumber
public static boolean isAllNumber(String str) { boolean hasNumber = false; for (int i = 0; i < str.length(); i++) { if (!(Character.isDigit(str.charAt(i)) || str.charAt(i) == '.' || str.charAt(i) == ',' || str.charAt(i) == '%' || str.charAt(i) == '$' || str.charAt(i) == '_')) { return fal...
java
public static boolean isAllNumber(String str) { boolean hasNumber = false; for (int i = 0; i < str.length(); i++) { if (!(Character.isDigit(str.charAt(i)) || str.charAt(i) == '.' || str.charAt(i) == ',' || str.charAt(i) == '%' || str.charAt(i) == '$' || str.charAt(i) == '_')) { return fal...
[ "public", "static", "boolean", "isAllNumber", "(", "String", "str", ")", "{", "boolean", "hasNumber", "=", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "str", ".", "length", "(", ")", ";", "i", "++", ")", "{", "if", "(", "!", ...
Checks if is all number. @param str the string @return true, if str consists all numbers
[ "Checks", "if", "is", "all", "number", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L158-L173
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.isFirstCap
public static boolean isFirstCap(String str) { if (isAllCap(str)) return false; if (str.length() > 0 && Character.isLetter(str.charAt(0)) && Character.isUpperCase(str.charAt(0))) { return true; } return false; }
java
public static boolean isFirstCap(String str) { if (isAllCap(str)) return false; if (str.length() > 0 && Character.isLetter(str.charAt(0)) && Character.isUpperCase(str.charAt(0))) { return true; } return false; }
[ "public", "static", "boolean", "isFirstCap", "(", "String", "str", ")", "{", "if", "(", "isAllCap", "(", "str", ")", ")", "return", "false", ";", "if", "(", "str", ".", "length", "(", ")", ">", "0", "&&", "Character", ".", "isLetter", "(", "str", "...
Checks if is first cap. @param str the string @return true, if str has the first character capitalized
[ "Checks", "if", "is", "first", "cap", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L181-L190
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.endsWithPunc
public static boolean endsWithPunc(String str) { if (str.endsWith(".") || str.endsWith("?") || str.endsWith("!") || str.endsWith(",") || str.endsWith(":") || str.endsWith("\"") || str.endsWith("'") || str.endsWith("''") || str.endsWith(";")) { return true; } return false; }
java
public static boolean endsWithPunc(String str) { if (str.endsWith(".") || str.endsWith("?") || str.endsWith("!") || str.endsWith(",") || str.endsWith(":") || str.endsWith("\"") || str.endsWith("'") || str.endsWith("''") || str.endsWith(";")) { return true; } return false; }
[ "public", "static", "boolean", "endsWithPunc", "(", "String", "str", ")", "{", "if", "(", "str", ".", "endsWith", "(", "\".\"", ")", "||", "str", ".", "endsWith", "(", "\"?\"", ")", "||", "str", ".", "endsWith", "(", "\"!\"", ")", "||", "str", ".", ...
Ends with sign. @param str the string token to test @return true, if this token is ended with punctuation (such as ?:\;)
[ "Ends", "with", "sign", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L230-L238
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.endsWithStop
public static boolean endsWithStop(String str) { if (str.endsWith(".") || str.endsWith("?") || str.endsWith("!")) { return true; } return false; }
java
public static boolean endsWithStop(String str) { if (str.endsWith(".") || str.endsWith("?") || str.endsWith("!")) { return true; } return false; }
[ "public", "static", "boolean", "endsWithStop", "(", "String", "str", ")", "{", "if", "(", "str", ".", "endsWith", "(", "\".\"", ")", "||", "str", ".", "endsWith", "(", "\"?\"", ")", "||", "str", ".", "endsWith", "(", "\"!\"", ")", ")", "{", "return",...
Ends with stop. @param str the string @return true, if this token is ended with stop '.'
[ "Ends", "with", "stop", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L246-L252
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.countStops
public static int countStops(String str) { int count = 0; for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == '.' || str.charAt(i) == '?' || str.charAt(i) == '!') { count++; } } return count; }
java
public static int countStops(String str) { int count = 0; for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == '.' || str.charAt(i) == '?' || str.charAt(i) == '!') { count++; } } return count; }
[ "public", "static", "int", "countStops", "(", "String", "str", ")", "{", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "str", ".", "length", "(", ")", ";", "i", "++", ")", "{", "if", "(", "str", ".", "charAt"...
Count stops. @param str string @return how many stops '.' str contains
[ "Count", "stops", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L260-L270
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.countPuncs
public static int countPuncs(String str) { int count = 0; for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == '.' || str.charAt(i) == '?' || str.charAt(i) == '!' || str.charAt(i) == ',' || str.charAt(i) == ':' || str.charAt(i) == ';') { count++; } } return count; ...
java
public static int countPuncs(String str) { int count = 0; for (int i = 0; i < str.length(); i++) { if (str.charAt(i) == '.' || str.charAt(i) == '?' || str.charAt(i) == '!' || str.charAt(i) == ',' || str.charAt(i) == ':' || str.charAt(i) == ';') { count++; } } return count; ...
[ "public", "static", "int", "countPuncs", "(", "String", "str", ")", "{", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "str", ".", "length", "(", ")", ";", "i", "++", ")", "{", "if", "(", "str", ".", "charAt"...
Count signs. @param str string @return the number of punctuation marks in this token
[ "Count", "signs", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L278-L289
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.isStop
public static boolean isStop(String str) { if (str.compareTo(".") == 0) { return true; } if (str.compareTo("?") == 0) { return true; } if (str.compareTo("!") == 0) { return true; } return false; }
java
public static boolean isStop(String str) { if (str.compareTo(".") == 0) { return true; } if (str.compareTo("?") == 0) { return true; } if (str.compareTo("!") == 0) { return true; } return false; }
[ "public", "static", "boolean", "isStop", "(", "String", "str", ")", "{", "if", "(", "str", ".", "compareTo", "(", "\".\"", ")", "==", "0", ")", "{", "return", "true", ";", "}", "if", "(", "str", ".", "compareTo", "(", "\"?\"", ")", "==", "0", ")"...
Checks if is stop. @param str string @return true, if the input is the stop character '.'
[ "Checks", "if", "is", "stop", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L297-L311
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.isPunc
public static boolean isPunc(String str) { if (str == null) return false; str = str.trim(); for (int i = 0; i < str.length(); ++i){ char c = str.charAt(i); if (Character.isDigit(c) || Character.isLetter(c)){ return false; } } return true; }
java
public static boolean isPunc(String str) { if (str == null) return false; str = str.trim(); for (int i = 0; i < str.length(); ++i){ char c = str.charAt(i); if (Character.isDigit(c) || Character.isLetter(c)){ return false; } } return true; }
[ "public", "static", "boolean", "isPunc", "(", "String", "str", ")", "{", "if", "(", "str", "==", "null", ")", "return", "false", ";", "str", "=", "str", ".", "trim", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "str", ".", ...
Checks if is punctuation. @param str the string token to test @return true, if the input is one of the punctuation marks
[ "Checks", "if", "is", "punctuation", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L319-L330
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.capitalizeWord
public static String capitalizeWord( String s ) { // validate if( (s == null) || (s.length() == 0) ) { return s; } return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase(); }
java
public static String capitalizeWord( String s ) { // validate if( (s == null) || (s.length() == 0) ) { return s; } return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase(); }
[ "public", "static", "String", "capitalizeWord", "(", "String", "s", ")", "{", "// validate\r", "if", "(", "(", "s", "==", "null", ")", "||", "(", "s", ".", "length", "(", ")", "==", "0", ")", ")", "{", "return", "s", ";", "}", "return", "s", ".",...
Capitalises the first letter of a given string. @param s the input string @return the capitalized string
[ "Capitalises", "the", "first", "letter", "of", "a", "given", "string", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L397-L405
train
HeidelTime/heideltime
src/jvntextpro/util/StringUtils.java
StringUtils.sort
public static String sort( String s ) { char[] chars = s.toCharArray(); Arrays.sort( chars ); return new String( chars ); }
java
public static String sort( String s ) { char[] chars = s.toCharArray(); Arrays.sort( chars ); return new String( chars ); }
[ "public", "static", "String", "sort", "(", "String", "s", ")", "{", "char", "[", "]", "chars", "=", "s", ".", "toCharArray", "(", ")", ";", "Arrays", ".", "sort", "(", "chars", ")", ";", "return", "new", "String", "(", "chars", ")", ";", "}" ]
Sorts the characters in the specified string. @param s input String to sort. @return output String, containing sorted characters.
[ "Sorts", "the", "characters", "in", "the", "specified", "string", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L462-L467
train
HeidelTime/heideltime
src/jvntextpro/conversion/CompositeUnicode2Unicode.java
CompositeUnicode2Unicode.convert
public String convert(String text){ String ret = text; if (cpsUni2Uni == null) return ret; Iterator<String> it = cpsUni2Uni.keySet().iterator(); while(it.hasNext()){ String cpsChar = it.next(); ret = ret.replaceAll(cpsChar, cpsUni2Uni.get(cpsChar)); } return ret; }
java
public String convert(String text){ String ret = text; if (cpsUni2Uni == null) return ret; Iterator<String> it = cpsUni2Uni.keySet().iterator(); while(it.hasNext()){ String cpsChar = it.next(); ret = ret.replaceAll(cpsChar, cpsUni2Uni.get(cpsChar)); } return ret; }
[ "public", "String", "convert", "(", "String", "text", ")", "{", "String", "ret", "=", "text", ";", "if", "(", "cpsUni2Uni", "==", "null", ")", "return", "ret", ";", "Iterator", "<", "String", ">", "it", "=", "cpsUni2Uni", ".", "keySet", "(", ")", "."...
Convert a vietnamese string with composite unicode encoding to unicode encoding. @param text string in vietnamese with composite unicode encoding @return string with unicode encoding
[ "Convert", "a", "vietnamese", "string", "with", "composite", "unicode", "encoding", "to", "unicode", "encoding", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/conversion/CompositeUnicode2Unicode.java#L93-L106
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/utilities/Logger.java
Logger.printDetail
public static void printDetail(Class<?> c, String msg) { if(Logger.printDetails) { String preamble; if(c != null) preamble = "["+c.getSimpleName()+"]"; else preamble = ""; synchronized(System.err) { System.err.println(preamble+" "+msg); } } }
java
public static void printDetail(Class<?> c, String msg) { if(Logger.printDetails) { String preamble; if(c != null) preamble = "["+c.getSimpleName()+"]"; else preamble = ""; synchronized(System.err) { System.err.println(preamble+" "+msg); } } }
[ "public", "static", "void", "printDetail", "(", "Class", "<", "?", ">", "c", ",", "String", "msg", ")", "{", "if", "(", "Logger", ".", "printDetails", ")", "{", "String", "preamble", ";", "if", "(", "c", "!=", "null", ")", "preamble", "=", "\"[\"", ...
print DEBUG level information with package name @param component Component from which the message originates @param msg DEBUG-level message
[ "print", "DEBUG", "level", "information", "with", "package", "name" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/utilities/Logger.java#L27-L39
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/utilities/Logger.java
Logger.printError
public static void printError(Class<?> c, String msg) { String preamble; if(c != null) preamble = "["+c.getSimpleName()+"]"; else preamble = ""; synchronized(System.err) { System.err.println(preamble+" "+msg); } }
java
public static void printError(Class<?> c, String msg) { String preamble; if(c != null) preamble = "["+c.getSimpleName()+"]"; else preamble = ""; synchronized(System.err) { System.err.println(preamble+" "+msg); } }
[ "public", "static", "void", "printError", "(", "Class", "<", "?", ">", "c", ",", "String", "msg", ")", "{", "String", "preamble", ";", "if", "(", "c", "!=", "null", ")", "preamble", "=", "\"[\"", "+", "c", ".", "getSimpleName", "(", ")", "+", "\"]\...
print an ERROR-Level message with package name @param component Component from which the message originates @param msg ERROR-Level message
[ "print", "an", "ERROR", "-", "Level", "message", "with", "package", "name" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/utilities/Logger.java#L54-L64
train
HeidelTime/heideltime
src/jvnsegmenter/BasicContextGenerator.java
BasicContextGenerator.readFeatureParameters
protected boolean readFeatureParameters(Element node){ try{ NodeList childrent = node.getChildNodes(); cpnames = new Vector<String>(); paras = new Vector<Vector<Integer>>(); for (int i = 0; i < childrent.getLength(); i++) if (childrent.item(i) instanceof Element) { Element child = (El...
java
protected boolean readFeatureParameters(Element node){ try{ NodeList childrent = node.getChildNodes(); cpnames = new Vector<String>(); paras = new Vector<Vector<Integer>>(); for (int i = 0; i < childrent.getLength(); i++) if (childrent.item(i) instanceof Element) { Element child = (El...
[ "protected", "boolean", "readFeatureParameters", "(", "Element", "node", ")", "{", "try", "{", "NodeList", "childrent", "=", "node", ".", "getChildNodes", "(", ")", ";", "cpnames", "=", "new", "Vector", "<", "String", ">", "(", ")", ";", "paras", "=", "n...
Read feature parameters. @param node the node @return true, if successful
[ "Read", "feature", "parameters", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvnsegmenter/BasicContextGenerator.java#L60-L89
train
HeidelTime/heideltime
src/jvnsegmenter/BasicContextGenerator.java
BasicContextGenerator.readFeatureNodes
public static Vector<Element> readFeatureNodes(String templateFile){ Vector<Element> feaTypes = new Vector<Element>(); try { // Read feature template file........ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); In...
java
public static Vector<Element> readFeatureNodes(String templateFile){ Vector<Element> feaTypes = new Vector<Element>(); try { // Read feature template file........ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); In...
[ "public", "static", "Vector", "<", "Element", ">", "readFeatureNodes", "(", "String", "templateFile", ")", "{", "Vector", "<", "Element", ">", "feaTypes", "=", "new", "Vector", "<", "Element", ">", "(", ")", ";", "try", "{", "// Read feature template file........
Read feature nodes. @param templateFile the template file @return the vector
[ "Read", "feature", "nodes", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvnsegmenter/BasicContextGenerator.java#L97-L122
train
HeidelTime/heideltime
src/jvntextpro/data/TrainDataGenerating.java
TrainDataGenerating.generateTrainData
public void generateTrainData(String inputPath, String outputPath){ try{ File file = new File(inputPath); ArrayList<Sentence> data = new ArrayList<Sentence>(); if (file.isFile()){ System.out.println("Reading " + file.getName()); data = (ArrayList<Sentence>) reader.readFi...
java
public void generateTrainData(String inputPath, String outputPath){ try{ File file = new File(inputPath); ArrayList<Sentence> data = new ArrayList<Sentence>(); if (file.isFile()){ System.out.println("Reading " + file.getName()); data = (ArrayList<Sentence>) reader.readFi...
[ "public", "void", "generateTrainData", "(", "String", "inputPath", ",", "String", "outputPath", ")", "{", "try", "{", "File", "file", "=", "new", "File", "(", "inputPath", ")", ";", "ArrayList", "<", "Sentence", ">", "data", "=", "new", "ArrayList", "<", ...
Generate train data. @param inputPath the input path (file or dictionary) @param outputPath the output path
[ "Generate", "train", "data", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/data/TrainDataGenerating.java#L59-L104
train
HeidelTime/heideltime
src/jvntextpro/data/TaggingData.java
TaggingData.getContextStr
public String getContextStr(Sentence sent, int wordIdx){ String cpStr = ""; for (int i = 0; i < cntxGenVector.size(); ++i){ String [] context = cntxGenVector.get(i).getContext(sent, wordIdx); if (context != null){ for (int j = 0; j < context.length; ++j){ if (context[j].trim().equals("")) c...
java
public String getContextStr(Sentence sent, int wordIdx){ String cpStr = ""; for (int i = 0; i < cntxGenVector.size(); ++i){ String [] context = cntxGenVector.get(i).getContext(sent, wordIdx); if (context != null){ for (int j = 0; j < context.length; ++j){ if (context[j].trim().equals("")) c...
[ "public", "String", "getContextStr", "(", "Sentence", "sent", ",", "int", "wordIdx", ")", "{", "String", "cpStr", "=", "\"\"", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cntxGenVector", ".", "size", "(", ")", ";", "++", "i", ")", "{", ...
Gets the context str. @param sent the sentence @param wordIdx the word index @return the string representing contexts extracted at wordIdx of the sentence sent
[ "Gets", "the", "context", "str", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/data/TaggingData.java#L107-L121
train
HeidelTime/heideltime
src/jmaxent/Data.java
Data.writeCpMaps
public void writeCpMaps(Dictionary dict, PrintWriter fout) throws IOException { Iterator it = null; if (cpStr2Int == null) { return; } int count = 0; for (it = cpStr2Int.keySet().iterator(); it.hasNext(); ) { String cpStr = (String)it.next(); Integer cpInt = (Integer)cpStr2Int.get(cpStr); ...
java
public void writeCpMaps(Dictionary dict, PrintWriter fout) throws IOException { Iterator it = null; if (cpStr2Int == null) { return; } int count = 0; for (it = cpStr2Int.keySet().iterator(); it.hasNext(); ) { String cpStr = (String)it.next(); Integer cpInt = (Integer)cpStr2Int.get(cpStr); ...
[ "public", "void", "writeCpMaps", "(", "Dictionary", "dict", ",", "PrintWriter", "fout", ")", "throws", "IOException", "{", "Iterator", "it", "=", "null", ";", "if", "(", "cpStr2Int", "==", "null", ")", "{", "return", ";", "}", "int", "count", "=", "0", ...
Write cp maps. @param dict the dict @param fout the fout @throws IOException Signals that an I/O exception has occurred.
[ "Write", "cp", "maps", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jmaxent/Data.java#L158-L195
train
HeidelTime/heideltime
src/jmaxent/Data.java
Data.writeLbMaps
public void writeLbMaps(PrintWriter fout) throws IOException { if (lbStr2Int == null) { return; } // write the map size fout.println(Integer.toString(lbStr2Int.size())); for (Iterator it = lbStr2Int.keySet().iterator(); it.hasNext(); ) { String lbStr = (String)it.next(); Integer lbInt = (Integer...
java
public void writeLbMaps(PrintWriter fout) throws IOException { if (lbStr2Int == null) { return; } // write the map size fout.println(Integer.toString(lbStr2Int.size())); for (Iterator it = lbStr2Int.keySet().iterator(); it.hasNext(); ) { String lbStr = (String)it.next(); Integer lbInt = (Integer...
[ "public", "void", "writeLbMaps", "(", "PrintWriter", "fout", ")", "throws", "IOException", "{", "if", "(", "lbStr2Int", "==", "null", ")", "{", "return", ";", "}", "// write the map size", "fout", ".", "println", "(", "Integer", ".", "toString", "(", "lbStr2...
Write lb maps. @param fout the fout @throws IOException Signals that an I/O exception has occurred.
[ "Write", "lb", "maps", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jmaxent/Data.java#L279-L296
train
HeidelTime/heideltime
src/jmaxent/Data.java
Data.readTstData
public void readTstData(String dataFile) { if (tstData != null) { tstData.clear(); } else { tstData = new ArrayList(); } // open data file BufferedReader fin = null; try { fin = new BufferedReader(new InputStreamReader(new FileInputStream(dataFile), "UTF-8")); System.out.println("Read...
java
public void readTstData(String dataFile) { if (tstData != null) { tstData.clear(); } else { tstData = new ArrayList(); } // open data file BufferedReader fin = null; try { fin = new BufferedReader(new InputStreamReader(new FileInputStream(dataFile), "UTF-8")); System.out.println("Read...
[ "public", "void", "readTstData", "(", "String", "dataFile", ")", "{", "if", "(", "tstData", "!=", "null", ")", "{", "tstData", ".", "clear", "(", ")", ";", "}", "else", "{", "tstData", "=", "new", "ArrayList", "(", ")", ";", "}", "// open data file\t",...
Read tst data. @param dataFile the data file
[ "Read", "tst", "data", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jmaxent/Data.java#L434-L503
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.setFilename
public void setFilename(String v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_filename == null) jcasType.jcas.throwFeatMissing("filename", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setStringValue(addr, ((Event_Type)jcasType).casFeatCode_filename, v);}
java
public void setFilename(String v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_filename == null) jcasType.jcas.throwFeatMissing("filename", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setStringValue(addr, ((Event_Type)jcasType).casFeatCode_filename, v);}
[ "public", "void", "setFilename", "(", "String", "v", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_filename", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(",...
setter for filename - sets @generated @param v value to set into the feature
[ "setter", "for", "filename", "-", "sets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L82-L85
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.getTokId
public int getTokId() { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_tokId == null) jcasType.jcas.throwFeatMissing("tokId", "de.unihd.dbs.uima.types.heideltime.Event"); return jcasType.ll_cas.ll_getIntValue(addr, ((Event_Type)jcasType).casFeatCode_tokId);}
java
public int getTokId() { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_tokId == null) jcasType.jcas.throwFeatMissing("tokId", "de.unihd.dbs.uima.types.heideltime.Event"); return jcasType.ll_cas.ll_getIntValue(addr, ((Event_Type)jcasType).casFeatCode_tokId);}
[ "public", "int", "getTokId", "(", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_tokId", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"tokId\"", ",", "...
getter for tokId - gets @generated @return value of the feature
[ "getter", "for", "tokId", "-", "gets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L117-L120
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.setTokId
public void setTokId(int v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_tokId == null) jcasType.jcas.throwFeatMissing("tokId", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setIntValue(addr, ((Event_Type)jcasType).casFeatCode_tokId, v);}
java
public void setTokId(int v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_tokId == null) jcasType.jcas.throwFeatMissing("tokId", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setIntValue(addr, ((Event_Type)jcasType).casFeatCode_tokId, v);}
[ "public", "void", "setTokId", "(", "int", "v", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_tokId", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"tok...
setter for tokId - sets @generated @param v value to set into the feature
[ "setter", "for", "tokId", "-", "sets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L126-L129
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.getEventId
public String getEventId() { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_eventId == null) jcasType.jcas.throwFeatMissing("eventId", "de.unihd.dbs.uima.types.heideltime.Event"); return jcasType.ll_cas.ll_getStringValue(addr, ((Event_Type)jcasType).casFeatCode_eventId);}
java
public String getEventId() { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_eventId == null) jcasType.jcas.throwFeatMissing("eventId", "de.unihd.dbs.uima.types.heideltime.Event"); return jcasType.ll_cas.ll_getStringValue(addr, ((Event_Type)jcasType).casFeatCode_eventId);}
[ "public", "String", "getEventId", "(", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_eventId", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"eventId\"", ...
getter for eventId - gets @generated @return value of the feature
[ "getter", "for", "eventId", "-", "gets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L139-L142
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.setEventId
public void setEventId(String v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_eventId == null) jcasType.jcas.throwFeatMissing("eventId", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setStringValue(addr, ((Event_Type)jcasType).casFeatCode_eventId, v);}
java
public void setEventId(String v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_eventId == null) jcasType.jcas.throwFeatMissing("eventId", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setStringValue(addr, ((Event_Type)jcasType).casFeatCode_eventId, v);}
[ "public", "void", "setEventId", "(", "String", "v", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_eventId", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", ...
setter for eventId - sets @generated @param v value to set into the feature
[ "setter", "for", "eventId", "-", "sets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L148-L151
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.getEventInstanceId
public int getEventInstanceId() { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_eventInstanceId == null) jcasType.jcas.throwFeatMissing("eventInstanceId", "de.unihd.dbs.uima.types.heideltime.Event"); return jcasType.ll_cas.ll_getIntValue(addr, ((Event_Type)jcasType).casFeatCode_eventInstanceI...
java
public int getEventInstanceId() { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_eventInstanceId == null) jcasType.jcas.throwFeatMissing("eventInstanceId", "de.unihd.dbs.uima.types.heideltime.Event"); return jcasType.ll_cas.ll_getIntValue(addr, ((Event_Type)jcasType).casFeatCode_eventInstanceI...
[ "public", "int", "getEventInstanceId", "(", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_eventInstanceId", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"...
getter for eventInstanceId - gets @generated @return value of the feature
[ "getter", "for", "eventInstanceId", "-", "gets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L161-L164
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.setEventInstanceId
public void setEventInstanceId(int v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_eventInstanceId == null) jcasType.jcas.throwFeatMissing("eventInstanceId", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setIntValue(addr, ((Event_Type)jcasType).casFeatCode_eventInstanceId...
java
public void setEventInstanceId(int v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_eventInstanceId == null) jcasType.jcas.throwFeatMissing("eventInstanceId", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setIntValue(addr, ((Event_Type)jcasType).casFeatCode_eventInstanceId...
[ "public", "void", "setEventInstanceId", "(", "int", "v", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_eventInstanceId", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissi...
setter for eventInstanceId - sets @generated @param v value to set into the feature
[ "setter", "for", "eventInstanceId", "-", "sets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L170-L173
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.getModality
public String getModality() { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_modality == null) jcasType.jcas.throwFeatMissing("modality", "de.unihd.dbs.uima.types.heideltime.Event"); return jcasType.ll_cas.ll_getStringValue(addr, ((Event_Type)jcasType).casFeatCode_modality);}
java
public String getModality() { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_modality == null) jcasType.jcas.throwFeatMissing("modality", "de.unihd.dbs.uima.types.heideltime.Event"); return jcasType.ll_cas.ll_getStringValue(addr, ((Event_Type)jcasType).casFeatCode_modality);}
[ "public", "String", "getModality", "(", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_modality", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"modality\""...
getter for modality - gets @generated @return value of the feature
[ "getter", "for", "modality", "-", "gets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L205-L208
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.setModality
public void setModality(String v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_modality == null) jcasType.jcas.throwFeatMissing("modality", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setStringValue(addr, ((Event_Type)jcasType).casFeatCode_modality, v);}
java
public void setModality(String v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_modality == null) jcasType.jcas.throwFeatMissing("modality", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setStringValue(addr, ((Event_Type)jcasType).casFeatCode_modality, v);}
[ "public", "void", "setModality", "(", "String", "v", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_modality", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(",...
setter for modality - sets @generated @param v value to set into the feature
[ "setter", "for", "modality", "-", "sets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L214-L217
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.getTense
public String getTense() { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_tense == null) jcasType.jcas.throwFeatMissing("tense", "de.unihd.dbs.uima.types.heideltime.Event"); return jcasType.ll_cas.ll_getStringValue(addr, ((Event_Type)jcasType).casFeatCode_tense);}
java
public String getTense() { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_tense == null) jcasType.jcas.throwFeatMissing("tense", "de.unihd.dbs.uima.types.heideltime.Event"); return jcasType.ll_cas.ll_getStringValue(addr, ((Event_Type)jcasType).casFeatCode_tense);}
[ "public", "String", "getTense", "(", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_tense", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"tense\"", ",", ...
getter for tense - gets @generated @return value of the feature
[ "getter", "for", "tense", "-", "gets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L249-L252
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.setTense
public void setTense(String v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_tense == null) jcasType.jcas.throwFeatMissing("tense", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setStringValue(addr, ((Event_Type)jcasType).casFeatCode_tense, v);}
java
public void setTense(String v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_tense == null) jcasType.jcas.throwFeatMissing("tense", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setStringValue(addr, ((Event_Type)jcasType).casFeatCode_tense, v);}
[ "public", "void", "setTense", "(", "String", "v", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_tense", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"...
setter for tense - sets @generated @param v value to set into the feature
[ "setter", "for", "tense", "-", "sets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L258-L261
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Event.java
Event.setToken
public void setToken(Token v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_token == null) jcasType.jcas.throwFeatMissing("token", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setRefValue(addr, ((Event_Type)jcasType).casFeatCode_token, jcasType.ll_cas.ll_getFSRef(v));}
java
public void setToken(Token v) { if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_token == null) jcasType.jcas.throwFeatMissing("token", "de.unihd.dbs.uima.types.heideltime.Event"); jcasType.ll_cas.ll_setRefValue(addr, ((Event_Type)jcasType).casFeatCode_token, jcasType.ll_cas.ll_getFSRef(v));}
[ "public", "void", "setToken", "(", "Token", "v", ")", "{", "if", "(", "Event_Type", ".", "featOkTst", "&&", "(", "(", "Event_Type", ")", "jcasType", ")", ".", "casFeat_token", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"t...
setter for token - sets @generated @param v value to set into the feature
[ "setter", "for", "token", "-", "sets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Event.java#L280-L283
train
HeidelTime/heideltime
src/jvntextpro/data/Sentence.java
Sentence.addTWord
public void addTWord(String word, String tag){ TWord tword = new TWord(word, tag); sentence.add(tword); }
java
public void addTWord(String word, String tag){ TWord tword = new TWord(word, tag); sentence.add(tword); }
[ "public", "void", "addTWord", "(", "String", "word", ",", "String", "tag", ")", "{", "TWord", "tword", "=", "new", "TWord", "(", "word", ",", "tag", ")", ";", "sentence", ".", "add", "(", "tword", ")", ";", "}" ]
Adds the t word. @param word the word @param tag the tag
[ "Adds", "the", "t", "word", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/data/Sentence.java#L66-L69
train
HeidelTime/heideltime
src/hr/fer/zemris/takelab/uima/annotator/hunpos/HunPosTaggerWrapper.java
HunPosTaggerWrapper.initialize
public void initialize(Language language, String hunpos_path, String hunpos_model_path, Boolean annotateTokens, Boolean annotateSentences, Boolean annotatePOS) { this.initialize(new HunPosTaggerContext(language, hunpos_path, hunpos_model_path, annotateTokens, annotateSentences, annotatePOS)); }
java
public void initialize(Language language, String hunpos_path, String hunpos_model_path, Boolean annotateTokens, Boolean annotateSentences, Boolean annotatePOS) { this.initialize(new HunPosTaggerContext(language, hunpos_path, hunpos_model_path, annotateTokens, annotateSentences, annotatePOS)); }
[ "public", "void", "initialize", "(", "Language", "language", ",", "String", "hunpos_path", ",", "String", "hunpos_model_path", ",", "Boolean", "annotateTokens", ",", "Boolean", "annotateSentences", ",", "Boolean", "annotatePOS", ")", "{", "this", ".", "initialize", ...
Initializes the wrapper with the given language and settings what to annotate. Sentences will not be annotated, even if set to True, unless POS annotation occurs. @param language Language used by the wrapper, determines which rule files are read @param annotateTokens Are tokens to be annotated? @param annotateSentences...
[ "Initializes", "the", "wrapper", "with", "the", "given", "language", "and", "settings", "what", "to", "annotate", ".", "Sentences", "will", "not", "be", "annotated", "even", "if", "set", "to", "True", "unless", "POS", "annotation", "occurs", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/hr/fer/zemris/takelab/uima/annotator/hunpos/HunPosTaggerWrapper.java#L79-L81
train
HeidelTime/heideltime
src/hr/fer/zemris/takelab/uima/annotator/hunpos/HunPosTaggerWrapper.java
HunPosTaggerWrapper.initialize
public void initialize(UimaContext aContext) { annotate_tokens = (Boolean) aContext.getConfigParameterValue(PARAM_ANNOTATE_TOKENS); annotate_sentences = (Boolean) aContext.getConfigParameterValue(PARAM_ANNOTATE_SENTENCES); annotate_pos = (Boolean) aContext.getConfigParameterValue(PARAM_ANNOTATE_POS); this.langu...
java
public void initialize(UimaContext aContext) { annotate_tokens = (Boolean) aContext.getConfigParameterValue(PARAM_ANNOTATE_TOKENS); annotate_sentences = (Boolean) aContext.getConfigParameterValue(PARAM_ANNOTATE_SENTENCES); annotate_pos = (Boolean) aContext.getConfigParameterValue(PARAM_ANNOTATE_POS); this.langu...
[ "public", "void", "initialize", "(", "UimaContext", "aContext", ")", "{", "annotate_tokens", "=", "(", "Boolean", ")", "aContext", ".", "getConfigParameterValue", "(", "PARAM_ANNOTATE_TOKENS", ")", ";", "annotate_sentences", "=", "(", "Boolean", ")", "aContext", "...
Initializes the wrapper from UIMA context. See other initialize method for parameters required within context.
[ "Initializes", "the", "wrapper", "from", "UIMA", "context", ".", "See", "other", "initialize", "method", "for", "parameters", "required", "within", "context", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/hr/fer/zemris/takelab/uima/annotator/hunpos/HunPosTaggerWrapper.java#L86-L95
train
HeidelTime/heideltime
src/jvnsensegmenter/JVnSenSegmenter.java
JVnSenSegmenter.init
public boolean init(String modelDir){ try { classifier = new Classification(modelDir); feaGen = new FeatureGenerator(); classifier.init(); return true; } catch(Exception e){ System.out.println("Error while initilizing classifier: " + e.getMessage()); return fa...
java
public boolean init(String modelDir){ try { classifier = new Classification(modelDir); feaGen = new FeatureGenerator(); classifier.init(); return true; } catch(Exception e){ System.out.println("Error while initilizing classifier: " + e.getMessage()); return fa...
[ "public", "boolean", "init", "(", "String", "modelDir", ")", "{", "try", "{", "classifier", "=", "new", "Classification", "(", "modelDir", ")", ";", "feaGen", "=", "new", "FeatureGenerator", "(", ")", ";", "classifier", ".", "init", "(", ")", ";", "retur...
Creates a new instance of JVnSenSegmenter. @param modelDir the model dir @return true, if successful
[ "Creates", "a", "new", "instance", "of", "JVnSenSegmenter", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvnsensegmenter/JVnSenSegmenter.java#L56-L67
train
HeidelTime/heideltime
src/jvnsensegmenter/JVnSenSegmenter.java
JVnSenSegmenter.main
public static void main(String args[]){ if (args.length != 4){ displayHelp(); System.exit(1); } try{ JVnSenSegmenter senSegmenter = new JVnSenSegmenter(); senSegmenter.init(args[1]); String option = arg...
java
public static void main(String args[]){ if (args.length != 4){ displayHelp(); System.exit(1); } try{ JVnSenSegmenter senSegmenter = new JVnSenSegmenter(); senSegmenter.init(args[1]); String option = arg...
[ "public", "static", "void", "main", "(", "String", "args", "[", "]", ")", "{", "if", "(", "args", ".", "length", "!=", "4", ")", "{", "displayHelp", "(", ")", ";", "System", ".", "exit", "(", "1", ")", ";", "}", "try", "{", "JVnSenSegmenter", "se...
main method of JVnSenSegmenter to use this tool from command line. @param args the arguments
[ "main", "method", "of", "JVnSenSegmenter", "to", "use", "this", "tool", "from", "command", "line", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvnsensegmenter/JVnSenSegmenter.java#L138-L178
train
HeidelTime/heideltime
src/jvnsensegmenter/JVnSenSegmenter.java
JVnSenSegmenter.senSegmentFile
private static void senSegmentFile(String infile, String outfile, JVnSenSegmenter senSegmenter ){ try{ BufferedReader in = new BufferedReader(new InputStreamReader( new FileInputStream(infile), "UTF-8")); BufferedWriter out = new BufferedWriter(new OutputStreamWriter( ...
java
private static void senSegmentFile(String infile, String outfile, JVnSenSegmenter senSegmenter ){ try{ BufferedReader in = new BufferedReader(new InputStreamReader( new FileInputStream(infile), "UTF-8")); BufferedWriter out = new BufferedWriter(new OutputStreamWriter( ...
[ "private", "static", "void", "senSegmentFile", "(", "String", "infile", ",", "String", "outfile", ",", "JVnSenSegmenter", "senSegmenter", ")", "{", "try", "{", "BufferedReader", "in", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "new", "Fi...
Segment sentences. @param infile the infile @param outfile the outfile @param senSegmenter the sen segmenter
[ "Segment", "sentences", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvnsensegmenter/JVnSenSegmenter.java#L187-L222
train
HeidelTime/heideltime
src/jvnsegmenter/LexiconContextGenerator.java
LexiconContextGenerator.loadVietnameseDict
public static void loadVietnameseDict(String filename) { try { FileInputStream in = new FileInputStream(filename); if (hsVietnameseDict == null) { hsVietnameseDict = new HashSet(); BufferedReader reader = new BufferedReader( new InputStreamReader(in, "UTF-8")); String line; while (...
java
public static void loadVietnameseDict(String filename) { try { FileInputStream in = new FileInputStream(filename); if (hsVietnameseDict == null) { hsVietnameseDict = new HashSet(); BufferedReader reader = new BufferedReader( new InputStreamReader(in, "UTF-8")); String line; while (...
[ "public", "static", "void", "loadVietnameseDict", "(", "String", "filename", ")", "{", "try", "{", "FileInputStream", "in", "=", "new", "FileInputStream", "(", "filename", ")", ";", "if", "(", "hsVietnameseDict", "==", "null", ")", "{", "hsVietnameseDict", "="...
Load vietnamese dict. @param filename the filename
[ "Load", "vietnamese", "dict", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvnsegmenter/LexiconContextGenerator.java#L192-L213
train
HeidelTime/heideltime
src/jvnsegmenter/LexiconContextGenerator.java
LexiconContextGenerator.loadViPersonalNames
public static void loadViPersonalNames(String filename) { try { FileInputStream in = new FileInputStream(filename); if (hsViFamilyNames == null) { hsViFamilyNames = new HashSet(); hsViLastNames = new HashSet(); hsViMiddleNames = new HashSet(); BufferedReader reader = new BufferedReade...
java
public static void loadViPersonalNames(String filename) { try { FileInputStream in = new FileInputStream(filename); if (hsViFamilyNames == null) { hsViFamilyNames = new HashSet(); hsViLastNames = new HashSet(); hsViMiddleNames = new HashSet(); BufferedReader reader = new BufferedReade...
[ "public", "static", "void", "loadViPersonalNames", "(", "String", "filename", ")", "{", "try", "{", "FileInputStream", "in", "=", "new", "FileInputStream", "(", "filename", ")", ";", "if", "(", "hsViFamilyNames", "==", "null", ")", "{", "hsViFamilyNames", "=",...
Load vi personal names. @param filename the filename
[ "Load", "vi", "personal", "names", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvnsegmenter/LexiconContextGenerator.java#L220-L264
train
HeidelTime/heideltime
src/jvnsegmenter/LexiconContextGenerator.java
LexiconContextGenerator.loadViLocationList
public static void loadViLocationList(String filename) { try { FileInputStream in = new FileInputStream(filename); if (hsViLocations == null) { hsViLocations = new HashSet(); BufferedReader reader = new BufferedReader( new InputStreamReader(in, "UTF-8")); String line; while ((line ...
java
public static void loadViLocationList(String filename) { try { FileInputStream in = new FileInputStream(filename); if (hsViLocations == null) { hsViLocations = new HashSet(); BufferedReader reader = new BufferedReader( new InputStreamReader(in, "UTF-8")); String line; while ((line ...
[ "public", "static", "void", "loadViLocationList", "(", "String", "filename", ")", "{", "try", "{", "FileInputStream", "in", "=", "new", "FileInputStream", "(", "filename", ")", ";", "if", "(", "hsViLocations", "==", "null", ")", "{", "hsViLocations", "=", "n...
Load vi location list. @param filename the filename
[ "Load", "vi", "location", "list", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvnsegmenter/LexiconContextGenerator.java#L271-L287
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Token.java
Token.getFilename
public String getFilename() { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_filename == null) jcasType.jcas.throwFeatMissing("filename", "de.unihd.dbs.uima.types.heideltime.Token"); return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jcasType).casFeatCode_filename);}
java
public String getFilename() { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_filename == null) jcasType.jcas.throwFeatMissing("filename", "de.unihd.dbs.uima.types.heideltime.Token"); return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jcasType).casFeatCode_filename);}
[ "public", "String", "getFilename", "(", ")", "{", "if", "(", "Token_Type", ".", "featOkTst", "&&", "(", "(", "Token_Type", ")", "jcasType", ")", ".", "casFeat_filename", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"filename\""...
getter for filename - gets @generated @return value of the feature
[ "getter", "for", "filename", "-", "gets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Token.java#L72-L75
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Token.java
Token.getTokenId
public int getTokenId() { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_tokenId == null) jcasType.jcas.throwFeatMissing("tokenId", "de.unihd.dbs.uima.types.heideltime.Token"); return jcasType.ll_cas.ll_getIntValue(addr, ((Token_Type)jcasType).casFeatCode_tokenId);}
java
public int getTokenId() { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_tokenId == null) jcasType.jcas.throwFeatMissing("tokenId", "de.unihd.dbs.uima.types.heideltime.Token"); return jcasType.ll_cas.ll_getIntValue(addr, ((Token_Type)jcasType).casFeatCode_tokenId);}
[ "public", "int", "getTokenId", "(", ")", "{", "if", "(", "Token_Type", ".", "featOkTst", "&&", "(", "(", "Token_Type", ")", "jcasType", ")", ".", "casFeat_tokenId", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"tokenId\"", ",...
getter for tokenId - gets @generated @return value of the feature
[ "getter", "for", "tokenId", "-", "gets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Token.java#L94-L97
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Token.java
Token.setTokenId
public void setTokenId(int v) { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_tokenId == null) jcasType.jcas.throwFeatMissing("tokenId", "de.unihd.dbs.uima.types.heideltime.Token"); jcasType.ll_cas.ll_setIntValue(addr, ((Token_Type)jcasType).casFeatCode_tokenId, v);}
java
public void setTokenId(int v) { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_tokenId == null) jcasType.jcas.throwFeatMissing("tokenId", "de.unihd.dbs.uima.types.heideltime.Token"); jcasType.ll_cas.ll_setIntValue(addr, ((Token_Type)jcasType).casFeatCode_tokenId, v);}
[ "public", "void", "setTokenId", "(", "int", "v", ")", "{", "if", "(", "Token_Type", ".", "featOkTst", "&&", "(", "(", "Token_Type", ")", "jcasType", ")", ".", "casFeat_tokenId", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\...
setter for tokenId - sets @generated @param v value to set into the feature
[ "setter", "for", "tokenId", "-", "sets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Token.java#L103-L106
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Token.java
Token.setSentId
public void setSentId(int v) { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_sentId == null) jcasType.jcas.throwFeatMissing("sentId", "de.unihd.dbs.uima.types.heideltime.Token"); jcasType.ll_cas.ll_setIntValue(addr, ((Token_Type)jcasType).casFeatCode_sentId, v);}
java
public void setSentId(int v) { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_sentId == null) jcasType.jcas.throwFeatMissing("sentId", "de.unihd.dbs.uima.types.heideltime.Token"); jcasType.ll_cas.ll_setIntValue(addr, ((Token_Type)jcasType).casFeatCode_sentId, v);}
[ "public", "void", "setSentId", "(", "int", "v", ")", "{", "if", "(", "Token_Type", ".", "featOkTst", "&&", "(", "(", "Token_Type", ")", "jcasType", ")", ".", "casFeat_sentId", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"s...
setter for sentId - sets @generated @param v value to set into the feature
[ "setter", "for", "sentId", "-", "sets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Token.java#L125-L128
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Token.java
Token.getPos
public String getPos() { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_pos == null) jcasType.jcas.throwFeatMissing("pos", "de.unihd.dbs.uima.types.heideltime.Token"); return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jcasType).casFeatCode_pos);}
java
public String getPos() { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_pos == null) jcasType.jcas.throwFeatMissing("pos", "de.unihd.dbs.uima.types.heideltime.Token"); return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jcasType).casFeatCode_pos);}
[ "public", "String", "getPos", "(", ")", "{", "if", "(", "Token_Type", ".", "featOkTst", "&&", "(", "(", "Token_Type", ")", "jcasType", ")", ".", "casFeat_pos", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"pos\"", ",", "\"d...
getter for pos - gets @generated @return value of the feature
[ "getter", "for", "pos", "-", "gets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Token.java#L138-L141
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/types/heideltime/Token.java
Token.setPos
public void setPos(String v) { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_pos == null) jcasType.jcas.throwFeatMissing("pos", "de.unihd.dbs.uima.types.heideltime.Token"); jcasType.ll_cas.ll_setStringValue(addr, ((Token_Type)jcasType).casFeatCode_pos, v);}
java
public void setPos(String v) { if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_pos == null) jcasType.jcas.throwFeatMissing("pos", "de.unihd.dbs.uima.types.heideltime.Token"); jcasType.ll_cas.ll_setStringValue(addr, ((Token_Type)jcasType).casFeatCode_pos, v);}
[ "public", "void", "setPos", "(", "String", "v", ")", "{", "if", "(", "Token_Type", ".", "featOkTst", "&&", "(", "(", "Token_Type", ")", "jcasType", ")", ".", "casFeat_pos", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", "\"pos\...
setter for pos - sets @generated @param v value to set into the feature
[ "setter", "for", "pos", "-", "sets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/types/heideltime/Token.java#L147-L150
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/processors/HolidayProcessor.java
HolidayProcessor.getEasterSunday
public String getEasterSunday(int year, int days) { int K = year / 100; int M = 15 + ( ( 3 * K + 3 ) / 4 ) - ( ( 8 * K + 13 ) / 25 ); int S = 2 - ( (3 * K + 3) / 4 ); int A = year % 19; int D = ( 19 * A + M ) % 30; int R = ( D / 29) + ( ( D / 28 ) - ( D / 29 ) * ( A / 11 ) ); int OG = 21 + D - R; int SZ...
java
public String getEasterSunday(int year, int days) { int K = year / 100; int M = 15 + ( ( 3 * K + 3 ) / 4 ) - ( ( 8 * K + 13 ) / 25 ); int S = 2 - ( (3 * K + 3) / 4 ); int A = year % 19; int D = ( 19 * A + M ) % 30; int R = ( D / 29) + ( ( D / 28 ) - ( D / 29 ) * ( A / 11 ) ); int OG = 21 + D - R; int SZ...
[ "public", "String", "getEasterSunday", "(", "int", "year", ",", "int", "days", ")", "{", "int", "K", "=", "year", "/", "100", ";", "int", "M", "=", "15", "+", "(", "(", "3", "*", "K", "+", "3", ")", "/", "4", ")", "-", "(", "(", "8", "*", ...
Get the date of a day relative to Easter Sunday in a given year. Algorithm used is from the "Physikalisch-Technische Bundesanstalt Braunschweig" PTB. @author Hans-Peter Pfeiffer @param year @param days @return date
[ "Get", "the", "date", "of", "a", "day", "relative", "to", "Easter", "Sunday", "in", "a", "given", "year", ".", "Algorithm", "used", "is", "from", "the", "Physikalisch", "-", "Technische", "Bundesanstalt", "Braunschweig", "PTB", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/processors/HolidayProcessor.java#L196-L226
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/processors/HolidayProcessor.java
HolidayProcessor.getShroveTideWeekOrthodox
public String getShroveTideWeekOrthodox(int year){ String easterOrthodox = getEasterSundayOrthodox(year); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); try{ Calendar calendar = Calendar.getInstance(); Date date = formatter.parse(easterOrthodox); ...
java
public String getShroveTideWeekOrthodox(int year){ String easterOrthodox = getEasterSundayOrthodox(year); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); try{ Calendar calendar = Calendar.getInstance(); Date date = formatter.parse(easterOrthodox); ...
[ "public", "String", "getShroveTideWeekOrthodox", "(", "int", "year", ")", "{", "String", "easterOrthodox", "=", "getEasterSundayOrthodox", "(", "year", ")", ";", "SimpleDateFormat", "formatter", "=", "new", "SimpleDateFormat", "(", "\"yyyy-MM-dd\"", ")", ";", "try",...
Get the date of the Shrove-Tide week in a given year @author Elena Klyachko @param year @return date
[ "Get", "the", "date", "of", "the", "Shrove", "-", "Tide", "week", "in", "a", "given", "year" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/processors/HolidayProcessor.java#L307-L325
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/processors/HolidayProcessor.java
HolidayProcessor.getWeekdayOfMonth
public String getWeekdayOfMonth(int number, int weekday, int month, int year) { return getWeekdayRelativeTo(String.format("%04d-%02d-01", year, month), weekday, number, true); }
java
public String getWeekdayOfMonth(int number, int weekday, int month, int year) { return getWeekdayRelativeTo(String.format("%04d-%02d-01", year, month), weekday, number, true); }
[ "public", "String", "getWeekdayOfMonth", "(", "int", "number", ",", "int", "weekday", ",", "int", "month", ",", "int", "year", ")", "{", "return", "getWeekdayRelativeTo", "(", "String", ".", "format", "(", "\"%04d-%02d-01\"", ",", "year", ",", "month", ")", ...
Get the date of a the first, second, third etc. weekday in a month @author Hans-Peter Pfeiffer @param number @param weekday @param month @param year @return date
[ "Get", "the", "date", "of", "a", "the", "first", "second", "third", "etc", ".", "weekday", "in", "a", "month" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/processors/HolidayProcessor.java#L401-L403
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java
RegexHashMap.containsKey
public boolean containsKey(Object key) { // the key is a direct hit from our cache if(cache.containsKey(key)) return true; // the key is a direct hit from our hashmap if(container.containsKey(key)) return true; // check if the requested key is a matching string of a regex key from our container Itera...
java
public boolean containsKey(Object key) { // the key is a direct hit from our cache if(cache.containsKey(key)) return true; // the key is a direct hit from our hashmap if(container.containsKey(key)) return true; // check if the requested key is a matching string of a regex key from our container Itera...
[ "public", "boolean", "containsKey", "(", "Object", "key", ")", "{", "// the key is a direct hit from our cache", "if", "(", "cache", ".", "containsKey", "(", "key", ")", ")", "return", "true", ";", "// the key is a direct hit from our hashmap", "if", "(", "container",...
checks whether the cache or container contain a specific key, then evaluates the container's keys as regexes and checks whether they match the specific key.
[ "checks", "whether", "the", "cache", "or", "container", "contain", "a", "specific", "key", "then", "evaluates", "the", "container", "s", "keys", "as", "regexes", "and", "checks", "whether", "they", "match", "the", "specific", "key", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java#L34-L51
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java
RegexHashMap.containsValue
public boolean containsValue(Object value) { // the value is a direct hit from our cache if(cache.containsValue(value)) return true; // the value is a direct hit from our hashmap if(container.containsValue(value)) return true; // otherwise, the value isn't within this object return false; }
java
public boolean containsValue(Object value) { // the value is a direct hit from our cache if(cache.containsValue(value)) return true; // the value is a direct hit from our hashmap if(container.containsValue(value)) return true; // otherwise, the value isn't within this object return false; }
[ "public", "boolean", "containsValue", "(", "Object", "value", ")", "{", "// the value is a direct hit from our cache", "if", "(", "cache", ".", "containsValue", "(", "value", ")", ")", "return", "true", ";", "// the value is a direct hit from our hashmap", "if", "(", ...
checks whether a specific value is container within either container or cache
[ "checks", "whether", "a", "specific", "value", "is", "container", "within", "either", "container", "or", "cache" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java#L56-L66
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java
RegexHashMap.entrySet
public Set<Entry<String, T>> entrySet() { // prepare the container HashSet<Entry<String, T>> set = new HashSet<Entry<String, T>>(); // add the set from our container set.addAll(container.entrySet()); // add the set from our cache set.addAll(cache.entrySet()); return set; }
java
public Set<Entry<String, T>> entrySet() { // prepare the container HashSet<Entry<String, T>> set = new HashSet<Entry<String, T>>(); // add the set from our container set.addAll(container.entrySet()); // add the set from our cache set.addAll(cache.entrySet()); return set; }
[ "public", "Set", "<", "Entry", "<", "String", ",", "T", ">", ">", "entrySet", "(", ")", "{", "// prepare the container", "HashSet", "<", "Entry", "<", "String", ",", "T", ">", ">", "set", "=", "new", "HashSet", "<", "Entry", "<", "String", ",", "T", ...
returns a merged entryset containing within both the container and cache entrysets
[ "returns", "a", "merged", "entryset", "containing", "within", "both", "the", "container", "and", "cache", "entrysets" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java#L71-L80
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java
RegexHashMap.get
public T get(Object key) { // output for requested key null is the value null; normal Map behavior if(key == null) return null; T result = null; if((result = cache.get(key)) != null) { // if the requested key maps to a value in the cache return result; } else if((result = container.get(key)) != null)...
java
public T get(Object key) { // output for requested key null is the value null; normal Map behavior if(key == null) return null; T result = null; if((result = cache.get(key)) != null) { // if the requested key maps to a value in the cache return result; } else if((result = container.get(key)) != null)...
[ "public", "T", "get", "(", "Object", "key", ")", "{", "// output for requested key null is the value null; normal Map behavior", "if", "(", "key", "==", "null", ")", "return", "null", ";", "T", "result", "=", "null", ";", "if", "(", "(", "result", "=", "cache"...
checks whether the requested key has a direct match in either cache or container, and if it doesn't, also evaluates the container's keyset as regexes to match against the input key and if any of those methods yield a value, returns that value if a value is found doing regex evaluation, use that regex-key's match as a n...
[ "checks", "whether", "the", "requested", "key", "has", "a", "direct", "match", "in", "either", "cache", "or", "container", "and", "if", "it", "doesn", "t", "also", "evaluates", "the", "container", "s", "keyset", "as", "regexes", "to", "match", "against", "...
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java#L89-L116
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java
RegexHashMap.keySet
public Set<String> keySet() { // prepare container HashSet<String> set = new HashSet<String>(); // add container keys set.addAll(container.keySet()); // add cache keys set.addAll(cache.keySet()); return set; }
java
public Set<String> keySet() { // prepare container HashSet<String> set = new HashSet<String>(); // add container keys set.addAll(container.keySet()); // add cache keys set.addAll(cache.keySet()); return set; }
[ "public", "Set", "<", "String", ">", "keySet", "(", ")", "{", "// prepare container", "HashSet", "<", "String", ">", "set", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "// add container keys", "set", ".", "addAll", "(", "container", ".", "k...
returns the keysets of both the container and cache hashmaps
[ "returns", "the", "keysets", "of", "both", "the", "container", "and", "cache", "hashmaps" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java#L128-L137
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java
RegexHashMap.put
public T put(String key, T value) { return container.put(key, value); }
java
public T put(String key, T value) { return container.put(key, value); }
[ "public", "T", "put", "(", "String", "key", ",", "T", "value", ")", "{", "return", "container", ".", "put", "(", "key", ",", "value", ")", ";", "}" ]
associates a key with a value in the container hashmap
[ "associates", "a", "key", "with", "a", "value", "in", "the", "container", "hashmap" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java#L142-L144
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java
RegexHashMap.putCache
public T putCache(String key, T value) { return cache.put(key, value); }
java
public T putCache(String key, T value) { return cache.put(key, value); }
[ "public", "T", "putCache", "(", "String", "key", ",", "T", "value", ")", "{", "return", "cache", ".", "put", "(", "key", ",", "value", ")", ";", "}" ]
associates a key with a value in the cache hashmap. @param key Key to map from @param value Value to map to @return previous value associated with the key, or null if unassociated before
[ "associates", "a", "key", "with", "a", "value", "in", "the", "cache", "hashmap", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java#L152-L154
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java
RegexHashMap.values
public Collection<T> values() { // prepare set HashSet<T> set = new HashSet<T>(); // add all container values set.addAll(container.values()); // add all cache values set.addAll(cache.values()); return set; }
java
public Collection<T> values() { // prepare set HashSet<T> set = new HashSet<T>(); // add all container values set.addAll(container.values()); // add all cache values set.addAll(cache.values()); return set; }
[ "public", "Collection", "<", "T", ">", "values", "(", ")", "{", "// prepare set", "HashSet", "<", "T", ">", "set", "=", "new", "HashSet", "<", "T", ">", "(", ")", ";", "// add all container values", "set", ".", "addAll", "(", "container", ".", "values", ...
returns the combined collection of both the values of the container as well as the cache.
[ "returns", "the", "combined", "collection", "of", "both", "the", "values", "of", "the", "container", "as", "well", "as", "the", "cache", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java#L181-L190
train
HeidelTime/heideltime
src/jmaxent/Option.java
Option.openTrainLogFile
public PrintWriter openTrainLogFile() { String filename = modelDir + File.separator + trainLogFile; PrintWriter fout = null; try { fout = new PrintWriter(new OutputStreamWriter( (new FileOutputStream(filename)), "UTF-8")); } catch (IOException e) { System.out.println(e.toString()); return null...
java
public PrintWriter openTrainLogFile() { String filename = modelDir + File.separator + trainLogFile; PrintWriter fout = null; try { fout = new PrintWriter(new OutputStreamWriter( (new FileOutputStream(filename)), "UTF-8")); } catch (IOException e) { System.out.println(e.toString()); return null...
[ "public", "PrintWriter", "openTrainLogFile", "(", ")", "{", "String", "filename", "=", "modelDir", "+", "File", ".", "separator", "+", "trainLogFile", ";", "PrintWriter", "fout", "=", "null", ";", "try", "{", "fout", "=", "new", "PrintWriter", "(", "new", ...
Open train log file. @return the prints the writer
[ "Open", "train", "log", "file", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jmaxent/Option.java#L254-L266
train
HeidelTime/heideltime
src/jmaxent/Option.java
Option.openModelFile
public BufferedReader openModelFile() { String filename = modelDir + File.separator + modelFile; BufferedReader fin = null; try { fin = new BufferedReader(new InputStreamReader(new FileInputStream(filename), "UTF-8")); } catch (IOException e) { System.out.println(e.toString()); return null; ...
java
public BufferedReader openModelFile() { String filename = modelDir + File.separator + modelFile; BufferedReader fin = null; try { fin = new BufferedReader(new InputStreamReader(new FileInputStream(filename), "UTF-8")); } catch (IOException e) { System.out.println(e.toString()); return null; ...
[ "public", "BufferedReader", "openModelFile", "(", ")", "{", "String", "filename", "=", "modelDir", "+", "File", ".", "separator", "+", "modelFile", ";", "BufferedReader", "fin", "=", "null", ";", "try", "{", "fin", "=", "new", "BufferedReader", "(", "new", ...
Open model file. @return the buffered reader
[ "Open", "model", "file", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jmaxent/Option.java#L273-L286
train
HeidelTime/heideltime
src/jmaxent/Option.java
Option.writeOptions
public void writeOptions(PrintWriter fout) { fout.println("OPTION VALUES:"); fout.println("=============="); fout.println("Model directory: " + modelDir); fout.println("Model file: " + modelFile); fout.println("Option file: " + optionFile); fout.println("Training log file: " + trainLogFile + " (this one)"); fou...
java
public void writeOptions(PrintWriter fout) { fout.println("OPTION VALUES:"); fout.println("=============="); fout.println("Model directory: " + modelDir); fout.println("Model file: " + modelFile); fout.println("Option file: " + optionFile); fout.println("Training log file: " + trainLogFile + " (this one)"); fou...
[ "public", "void", "writeOptions", "(", "PrintWriter", "fout", ")", "{", "fout", ".", "println", "(", "\"OPTION VALUES:\"", ")", ";", "fout", ".", "println", "(", "\"==============\"", ")", ";", "fout", ".", "println", "(", "\"Model directory: \"", "+", "modelD...
Write options. @param fout the fout
[ "Write", "options", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jmaxent/Option.java#L313-L345
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/utilities/DateCalculator.java
DateCalculator.getXNextDay
public static String getXNextDay(String date, Integer x) { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String newDate = ""; Calendar c = Calendar.getInstance(); try { c.setTime(formatter.parse(date)); c.add(Calendar.DAY_OF_MONTH, x); c.getTime(); newDate = formatter.format(c.get...
java
public static String getXNextDay(String date, Integer x) { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String newDate = ""; Calendar c = Calendar.getInstance(); try { c.setTime(formatter.parse(date)); c.add(Calendar.DAY_OF_MONTH, x); c.getTime(); newDate = formatter.format(c.get...
[ "public", "static", "String", "getXNextDay", "(", "String", "date", ",", "Integer", "x", ")", "{", "SimpleDateFormat", "formatter", "=", "new", "SimpleDateFormat", "(", "\"yyyy-MM-dd\"", ")", ";", "String", "newDate", "=", "\"\"", ";", "Calendar", "c", "=", ...
get the x-next day of date. @param date given date to get new date from @param x type of temporal event to search for @return
[ "get", "the", "x", "-", "next", "day", "of", "date", "." ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/utilities/DateCalculator.java#L149-L162
train
HeidelTime/heideltime
src/de/unihd/dbs/uima/annotator/heideltime/utilities/DateCalculator.java
DateCalculator.getXNextWeek
public static String getXNextWeek(String date, Integer x, Language language) { NormalizationManager nm = NormalizationManager.getInstance(language, false); String date_no_W = date.replace("W", ""); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-w"); String newDate = ""; Calendar c = Calendar.getInsta...
java
public static String getXNextWeek(String date, Integer x, Language language) { NormalizationManager nm = NormalizationManager.getInstance(language, false); String date_no_W = date.replace("W", ""); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-w"); String newDate = ""; Calendar c = Calendar.getInsta...
[ "public", "static", "String", "getXNextWeek", "(", "String", "date", ",", "Integer", "x", ",", "Language", "language", ")", "{", "NormalizationManager", "nm", "=", "NormalizationManager", ".", "getInstance", "(", "language", ",", "false", ")", ";", "String", "...
get the x-next week of date @param date current date @param x amount of weeks to go forward @return new week
[ "get", "the", "x", "-", "next", "week", "of", "date" ]
4ef5002eb5ecfeb818086ff7e394e792ee360335
https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/utilities/DateCalculator.java#L213-L229
train