code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public FSArray getDocuments() {
if (SourceFile_Type.featOkTst && ((SourceFile_Type)jcasType).casFeat_documents == null)
jcasType.jcas.throwFeatMissing("documents", "de.julielab.jules.types.ace.SourceFile");
return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((SourceFile_T... | java |
public void setDocuments(FSArray v) {
if (SourceFile_Type.featOkTst && ((SourceFile_Type)jcasType).casFeat_documents == null)
jcasType.jcas.throwFeatMissing("documents", "de.julielab.jules.types.ace.SourceFile");
jcasType.ll_cas.ll_setRefValue(addr, ((SourceFile_Type)jcasType).casFeatCode_documents, jcasT... | java |
public Document getDocuments(int i) {
if (SourceFile_Type.featOkTst && ((SourceFile_Type)jcasType).casFeat_documents == null)
jcasType.jcas.throwFeatMissing("documents", "de.julielab.jules.types.ace.SourceFile");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((SourceFile_Type)jcasTyp... | java |
public void setDocuments(int i, Document v) {
if (SourceFile_Type.featOkTst && ((SourceFile_Type)jcasType).casFeat_documents == null)
jcasType.jcas.throwFeatMissing("documents", "de.julielab.jules.types.ace.SourceFile");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((SourceFile_Typ... | java |
public String getAce_type() {
if (SourceFile_Type.featOkTst && ((SourceFile_Type)jcasType).casFeat_ace_type == null)
jcasType.jcas.throwFeatMissing("ace_type", "de.julielab.jules.types.ace.SourceFile");
return jcasType.ll_cas.ll_getStringValue(addr, ((SourceFile_Type)jcasType).casFeatCode_ace_type);} | java |
public void setAce_type(String v) {
if (SourceFile_Type.featOkTst && ((SourceFile_Type)jcasType).casFeat_ace_type == null)
jcasType.jcas.throwFeatMissing("ace_type", "de.julielab.jules.types.ace.SourceFile");
jcasType.ll_cas.ll_setStringValue(addr, ((SourceFile_Type)jcasType).casFeatCode_ace_type, v);} | java |
public void addAll(ExampleSet data)
{
for (int i=0;i<data.size();i++)
add(data.x(i), data.y(i), data.id(i));
} | java |
public String getAnnotationLevel() {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_annotationLevel == null)
jcasType.jcas.throwFeatMissing("annotationLevel", "de.julielab.jules.types.mmax.MMAXAnnotation");
return jcasType.ll_cas.ll_getStringValue(addr, ((MMAXAnnotation_Type)... | java |
public void setAnnotationLevel(String v) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_annotationLevel == null)
jcasType.jcas.throwFeatMissing("annotationLevel", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.ll_cas.ll_setStringValue(addr, ((MMAXAnnotation_Type)j... | java |
public FSArray getSegmentList() {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_segmentList == null)
jcasType.jcas.throwFeatMissing("segmentList", "de.julielab.jules.types.mmax.MMAXAnnotation");
return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(a... | java |
public void setSegmentList(FSArray v) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_segmentList == null)
jcasType.jcas.throwFeatMissing("segmentList", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.ll_cas.ll_setRefValue(addr, ((MMAXAnnotation_Type)jcasType).casFe... | java |
public AnnotationSegment getSegmentList(int i) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_segmentList == null)
jcasType.jcas.throwFeatMissing("segmentList", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(add... | java |
public void setSegmentList(int i, AnnotationSegment v) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_segmentList == null)
jcasType.jcas.throwFeatMissing("segmentList", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRef... | java |
public FSArray getAttributeList() {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_attributeList == null)
jcasType.jcas.throwFeatMissing("attributeList", "de.julielab.jules.types.mmax.MMAXAnnotation");
return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefV... | java |
public void setAttributeList(FSArray v) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_attributeList == null)
jcasType.jcas.throwFeatMissing("attributeList", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.ll_cas.ll_setRefValue(addr, ((MMAXAnnotation_Type)jcasType)... | java |
public MMAXAttribute getAttributeList(int i) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_attributeList == null)
jcasType.jcas.throwFeatMissing("attributeList", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(a... | java |
public void setAttributeList(int i, MMAXAttribute v) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_attributeList == null)
jcasType.jcas.throwFeatMissing("attributeList", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getR... | java |
public FSArray getPointerList() {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_pointerList == null)
jcasType.jcas.throwFeatMissing("pointerList", "de.julielab.jules.types.mmax.MMAXAnnotation");
return (FSArray)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(a... | java |
public void setPointerList(FSArray v) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_pointerList == null)
jcasType.jcas.throwFeatMissing("pointerList", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.ll_cas.ll_setRefValue(addr, ((MMAXAnnotation_Type)jcasType).casFe... | java |
public MMAXPointer getPointerList(int i) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_pointerList == null)
jcasType.jcas.throwFeatMissing("pointerList", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((M... | java |
public void setPointerList(int i, MMAXPointer v) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_pointerList == null)
jcasType.jcas.throwFeatMissing("pointerList", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(... | java |
public String getAdaptedCoveredText() {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_adaptedCoveredText == null)
jcasType.jcas.throwFeatMissing("adaptedCoveredText", "de.julielab.jules.types.mmax.MMAXAnnotation");
return jcasType.ll_cas.ll_getStringValue(addr, ((MMAXAnnotat... | java |
public void setAdaptedCoveredText(String v) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_adaptedCoveredText == null)
jcasType.jcas.throwFeatMissing("adaptedCoveredText", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.ll_cas.ll_setStringValue(addr, ((MMAXAnnotati... | java |
public void initializationComplete() {
if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(),
"process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_cpm_init_complete__CONFIG",
new Object[] {... | java |
public synchronized void batchProcessComplete() {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
"process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_method_ping__FINEST",
new Objec... | java |
private TreeObject createDummyModel() {
TreeObject to1 = new TreeObject("Inbox");
TreeObject to2 = new TreeObject("Drafts");
TreeObject to3 = new TreeObject("Sent");
TreeParent p1 = new TreeParent("me@this.com");
p1.addChild(to1);
p1.addChild(to2);
p1.addChild(to3... | java |
public static void runPipeline(File scriptFile, List<String> cliArgs)
throws IOException, UIMAException, ParseException {
if (!scriptFile.exists()) {
throw new IOException("Script file does not exist ("
+ scriptFile.getAbsolutePath() + ")");
}
LOG.inf... | java |
public MaxentModel getModel (ModelDomain domain) {
if (map.containsKey(domain)) {
return (MaxentModel)map.get(domain);
} else {
throw new NoSuchElementException("No model has been created for "+
"domain: " + domain);
}
} | java |
public String getBuilding() {
if (RoomNumber_Type.featOkTst && ((RoomNumber_Type)jcasType).casFeat_building == null)
jcasType.jcas.throwFeatMissing("building", "org.apache.uima.examples.RoomNumber");
return jcasType.ll_cas.ll_getStringValue(addr, ((RoomNumber_Type)jcasType).casFeatCode_building);} | java |
public void setBuilding(String v) {
if (RoomNumber_Type.featOkTst && ((RoomNumber_Type)jcasType).casFeat_building == null)
jcasType.jcas.throwFeatMissing("building", "org.apache.uima.examples.RoomNumber");
jcasType.ll_cas.ll_setStringValue(addr, ((RoomNumber_Type)jcasType).casFeatCode_building, v);} | java |
@Deprecated(/* Use script directly with appropriate paths */)
public static AnalysisEngineDescription getBrainregionRules()
throws ResourceInitializationException {
return createEngineDescription(RutaEngine.class,//
PARAM_MAIN_SCRIPT, "Main",//
PARAM_SCRIPT_PATHS,... | java |
public static String cleanBlockText(String text) {
// only keep text longer that 5
if (text == null || text.length() < 6)
return null;
// only keep text longer that 5
if (text.length() < 6) {
return null;
}
// keep only 1st line
int firstR... | java |
public java.util.List<Sec> getSec() {
if (sec == null) {
sec = new ArrayList<Sec>();
}
return this.sec;
} | java |
public java.util.List<Object> getNotesOrFnGroupOrGlossary() {
if (notesOrFnGroupOrGlossary == null) {
notesOrFnGroupOrGlossary = new ArrayList<Object>();
}
return this.notesOrFnGroupOrGlossary;
} | java |
public void addInstance(String src,String id,String text)
{
Instance inst = new Instance(src,id,text);
ArrayList list = (ArrayList)sourceLists.get(src);
if (list==null) {
list = new ArrayList();
sourceLists.put(src,list);
sourceNames.add(src);
}
... | java |
public Instance getInstance(String src, int j) {
return (Instance)((ArrayList)sourceLists.get(src)).get(j);
} | java |
public static String maxTruncStr(String source, int maxNrChars) {
if (source != null && source.length() > maxNrChars) {
return source.substring(0, maxNrChars);
} else {
return source;
}
} | java |
public double score(StringWrapper s, StringWrapper t) {
String S = s.unwrap(),
T =t.unwrap();
totalScore = 0.0;
if (S.equals(T)) {
matched = S.length();
return 1.0;
}
else {
sSize = S.length();
tSize = T.length();
// let S be the largest token
if (sSiz... | java |
public String explainScore(StringWrapper s, StringWrapper t) {
String S = s.unwrap(),
T = t.unwrap();
StringBuffer buff = new StringBuffer();
buff.append("\n****TagLinkToken****\n");
buff.append("Si=" + S + ", Tj=" + T + "\n");
double totalScore = 0.0;
if (S.equals(T)) {
matched = ... | java |
private double getScore(ArrayList candidateList) {
matched = 0;
largestIndex = -1;
double scoreValue = 0;
HashMap tMap = new HashMap(),
uMap = new HashMap();
java.util.Iterator it = candidateList.iterator();
while (it.hasNext()) {
TagLink.Candidates actualCandidates = (TagL... | java |
private ArrayList algorithm1(String S, String T) {
ArrayList candidateList = new ArrayList();
int bound = (int) (1.0 / tr);
for (int t = 0; t < S.length(); t++) {
char chT = S.charAt(t);
double lastTr = -1;
for (int u = Math.max(0, t - bound), flag = 0;
u < Math.min(t + b... | java |
private void sortList(ArrayList candidateList) {
java.util.Collections.sort(candidateList, new java.util.Comparator() {
public int compare(Object o1, Object o2) {
double scoreT = ( (TagLink.Candidates) o1).getScore();
double scoreU = ( (TagLink.Candidates) o2).getScore();
if(score... | java |
private double winkler(double totalScore, String S, String T) {
totalScore = totalScore + (getPrefix(S, T) * 0.1 * (1.0 - totalScore));
return totalScore;
} | java |
public String getStyleName() {
if (Style_Type.featOkTst && ((Style_Type)jcasType).casFeat_styleName == null)
jcasType.jcas.throwFeatMissing("styleName", "de.julielab.jules.types.Style");
return jcasType.ll_cas.ll_getStringValue(addr, ((Style_Type)jcasType).casFeatCode_styleName);} | java |
public void setStyleName(String v) {
if (Style_Type.featOkTst && ((Style_Type)jcasType).casFeat_styleName == null)
jcasType.jcas.throwFeatMissing("styleName", "de.julielab.jules.types.Style");
jcasType.ll_cas.ll_setStringValue(addr, ((Style_Type)jcasType).casFeatCode_styleName, v);} | java |
@Override
public int compareTo(BLine other) {
int pageCompare = new Integer(pageId).compareTo(other.pageId);
if (pageCompare != 0) {
return pageCompare;
}
int xCompare = new Float(region.x).compareTo(other.region.x);
if (xCompare != 0) {
return xComp... | java |
public final double[] eval(String[] context, double[] outsums) {
int[] activeOutcomes;
double[] activeParameters;
for (int oid=0; oid<numOutcomes; oid++) {
outsums[oid] = iprob;
numfeats[oid] = 0;
}
for (int i=0; i<context.length; i++) {
int contex... | java |
public final String getBestOutcome(double[] ocs) {
int best = 0;
for (int i = 1; i<ocs.length; i++)
if (ocs[i] > ocs[best]) best = i;
return ocNames[best];
} | java |
public int getIndex (String outcome) {
for (int i=0; i<ocNames.length; i++) {
if (ocNames[i].equals(outcome))
return i;
}
return -1;
} | java |
public static String extractText(Article article) {
StringBuilder sb = new StringBuilder();
// extract abstract
List<Abstract> abstracts = article.getFront().getArticleMeta()
.getAbstract();
for (Abstract abstrct : abstracts) {
for (Sec sec : abstrct.getSec()) {
processTextContent(sec.getAddressOrA... | java |
private static String removeNoise(String s) {
return s.replace(" ", " ").replace(" ", " ")//
// caused by omitting xref tags
.replace(" , ", " ").replace(" ( )", "")//
.replace(" ", " ").replace(" ", " ")// nbsp
.replace("[ – ]", " ").replace("[ ]", "");//
} | java |
public java.util.List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
return this.content;
} | java |
public String getSemtype() {
if (SurfaceForm_Type.featOkTst && ((SurfaceForm_Type)jcasType).casFeat_semtype == null)
jcasType.jcas.throwFeatMissing("semtype", "ch.epfl.bbp.uima.types.SurfaceForm");
return jcasType.ll_cas.ll_getStringValue(addr, ((SurfaceForm_Type)jcasType).casFeatCode_semtype);} | java |
public void setSemtype(String v) {
if (SurfaceForm_Type.featOkTst && ((SurfaceForm_Type)jcasType).casFeat_semtype == null)
jcasType.jcas.throwFeatMissing("semtype", "ch.epfl.bbp.uima.types.SurfaceForm");
jcasType.ll_cas.ll_setStringValue(addr, ((SurfaceForm_Type)jcasType).casFeatCode_semtype, v);} | java |
public String[] getContext(Object o) {
String s = (String)o;
int prevIndex = -1;
int index = s.indexOf(' ');
List cuts = new ArrayList();
while (index != -1) {
cuts.add(s.substring(prevIndex+1, index));
prevIndex = index;
index = s.indexOf(' ', ++index);
}
cuts.add(s.substring(prevIndex+1, s.lengt... | java |
public RegulationOfGeneExpression getRelation() {
if (GeneRegulationTemplate_Type.featOkTst && ((GeneRegulationTemplate_Type)jcasType).casFeat_relation == null)
jcasType.jcas.throwFeatMissing("relation", "de.julielab.jules.types.bootstrep.GeneRegulationTemplate");
return (RegulationOfGeneExpression)(jcasT... | java |
public void setRelation(RegulationOfGeneExpression v) {
if (GeneRegulationTemplate_Type.featOkTst && ((GeneRegulationTemplate_Type)jcasType).casFeat_relation == null)
jcasType.jcas.throwFeatMissing("relation", "de.julielab.jules.types.bootstrep.GeneRegulationTemplate");
jcasType.ll_cas.ll_setRefValue(addr... | java |
public Chemicals getLigand() {
if (GeneRegulationTemplate_Type.featOkTst && ((GeneRegulationTemplate_Type)jcasType).casFeat_ligand == null)
jcasType.jcas.throwFeatMissing("ligand", "de.julielab.jules.types.bootstrep.GeneRegulationTemplate");
return (Chemicals)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_ca... | java |
public void setLigand(Chemicals v) {
if (GeneRegulationTemplate_Type.featOkTst && ((GeneRegulationTemplate_Type)jcasType).casFeat_ligand == null)
jcasType.jcas.throwFeatMissing("ligand", "de.julielab.jules.types.bootstrep.GeneRegulationTemplate");
jcasType.ll_cas.ll_setRefValue(addr, ((GeneRegulationTempl... | java |
public CellGrowthCondition getCellGrowthCondition() {
if (GeneRegulationTemplate_Type.featOkTst && ((GeneRegulationTemplate_Type)jcasType).casFeat_cellGrowthCondition == null)
jcasType.jcas.throwFeatMissing("cellGrowthCondition", "de.julielab.jules.types.bootstrep.GeneRegulationTemplate");
return (CellGro... | java |
public void setCellGrowthCondition(CellGrowthCondition v) {
if (GeneRegulationTemplate_Type.featOkTst && ((GeneRegulationTemplate_Type)jcasType).casFeat_cellGrowthCondition == null)
jcasType.jcas.throwFeatMissing("cellGrowthCondition", "de.julielab.jules.types.bootstrep.GeneRegulationTemplate");
jcasType.... | java |
public InvestigationTechnique getInvestigationTechnique() {
if (GeneRegulationTemplate_Type.featOkTst && ((GeneRegulationTemplate_Type)jcasType).casFeat_investigationTechnique == null)
jcasType.jcas.throwFeatMissing("investigationTechnique", "de.julielab.jules.types.bootstrep.GeneRegulationTemplate");
ret... | java |
public void setInvestigationTechnique(InvestigationTechnique v) {
if (GeneRegulationTemplate_Type.featOkTst && ((GeneRegulationTemplate_Type)jcasType).casFeat_investigationTechnique == null)
jcasType.jcas.throwFeatMissing("investigationTechnique", "de.julielab.jules.types.bootstrep.GeneRegulationTemplate");
... | java |
public Sentence filter(Sentence sent)
{
//logger.debug("\"" + Array.toString(sent) + "\"");
int start = 0, end = sent.length() - 1;
boolean b = false;
for (int i=0;i<sent.length();i++)
{
if (sent.wordAt(i).getRole().equals(Word.AGENT_LABEL))
{
start = i - getSize();
b = true;
break;
... | java |
public String getForeName() {
if (AuthorInfo_Type.featOkTst && ((AuthorInfo_Type)jcasType).casFeat_foreName == null)
jcasType.jcas.throwFeatMissing("foreName", "de.julielab.jules.types.AuthorInfo");
return jcasType.ll_cas.ll_getStringValue(addr, ((AuthorInfo_Type)jcasType).casFeatCode_foreName);} | java |
public void setForeName(String v) {
if (AuthorInfo_Type.featOkTst && ((AuthorInfo_Type)jcasType).casFeat_foreName == null)
jcasType.jcas.throwFeatMissing("foreName", "de.julielab.jules.types.AuthorInfo");
jcasType.ll_cas.ll_setStringValue(addr, ((AuthorInfo_Type)jcasType).casFeatCode_foreName, v);} | java |
public String getAffiliation() {
if (AuthorInfo_Type.featOkTst && ((AuthorInfo_Type)jcasType).casFeat_affiliation == null)
jcasType.jcas.throwFeatMissing("affiliation", "de.julielab.jules.types.AuthorInfo");
return jcasType.ll_cas.ll_getStringValue(addr, ((AuthorInfo_Type)jcasType).casFeatCode_affiliation... | java |
public void setAffiliation(String v) {
if (AuthorInfo_Type.featOkTst && ((AuthorInfo_Type)jcasType).casFeat_affiliation == null)
jcasType.jcas.throwFeatMissing("affiliation", "de.julielab.jules.types.AuthorInfo");
jcasType.ll_cas.ll_setStringValue(addr, ((AuthorInfo_Type)jcasType).casFeatCode_affiliation,... | java |
public String getLastName() {
if (AuthorInfo_Type.featOkTst && ((AuthorInfo_Type)jcasType).casFeat_lastName == null)
jcasType.jcas.throwFeatMissing("lastName", "de.julielab.jules.types.AuthorInfo");
return jcasType.ll_cas.ll_getStringValue(addr, ((AuthorInfo_Type)jcasType).casFeatCode_lastName);} | java |
public void setLastName(String v) {
if (AuthorInfo_Type.featOkTst && ((AuthorInfo_Type)jcasType).casFeat_lastName == null)
jcasType.jcas.throwFeatMissing("lastName", "de.julielab.jules.types.AuthorInfo");
jcasType.ll_cas.ll_setStringValue(addr, ((AuthorInfo_Type)jcasType).casFeatCode_lastName, v);} | java |
public String getInitials() {
if (AuthorInfo_Type.featOkTst && ((AuthorInfo_Type)jcasType).casFeat_initials == null)
jcasType.jcas.throwFeatMissing("initials", "de.julielab.jules.types.AuthorInfo");
return jcasType.ll_cas.ll_getStringValue(addr, ((AuthorInfo_Type)jcasType).casFeatCode_initials);} | java |
public void setInitials(String v) {
if (AuthorInfo_Type.featOkTst && ((AuthorInfo_Type)jcasType).casFeat_initials == null)
jcasType.jcas.throwFeatMissing("initials", "de.julielab.jules.types.AuthorInfo");
jcasType.ll_cas.ll_setStringValue(addr, ((AuthorInfo_Type)jcasType).casFeatCode_initials, v);} | java |
public void add(String outcome, double p) {
outcomes.add(outcome);
probs.add(new Double(p));
score += Math.log(p);
} | java |
public void getProbs(double[] ps) {
for (int pi=0,pl=probs.size();pi<pl;pi++) {
ps[pi] = ((Double) probs.get(pi)).doubleValue();
}
} | java |
public LinkedList<Diff> diff_main(String text1, String text2,
boolean checklines) {
// Set a deadline by which time the diff must be complete.
long deadline;
if (Diff_Timeout <= 0) {
deadline = Long.MAX_VALUE;
} else {
deadline = System.currentTimeMill... | java |
private LinkedList<Diff> diff_main(String text1, String text2,
boolean checklines, long deadline) {
// Check for null inputs.
if (text1 == null || text2 == null) {
throw new IllegalArgumentException("Null inputs. (diff_main)");
}
// Check for equality (speedup).
... | java |
public String diff_prettyHtml(LinkedList<Diff> diffs) {
StringBuilder html = new StringBuilder();
for (Diff aDiff : diffs) {
String text = aDiff.text.replace("&", "&").replace("<", "<")
.replace(">", ">").replace("\n", "¶<br>");
switch (aDiff.op... | java |
public String diff_toDelta(LinkedList<Diff> diffs) {
StringBuilder text = new StringBuilder();
for (Diff aDiff : diffs) {
switch (aDiff.operation) {
case INSERT:
try {
text.append("+")
.append(URLEncoder.encode(aDiff... | java |
public static int match_main(String text, String pattern, int loc) {
// Check for null inputs.
if (text == null || pattern == null) {
throw new IllegalArgumentException("Null inputs. (match_main)");
}
loc = Math.max(0, Math.min(loc, text.length()));
if (text.equals(p... | java |
@SuppressWarnings("unused")
private static double match_bitapScore(int e, int x, int loc, String pattern) {
float accuracy = (float) e / pattern.length();
int proximity = Math.abs(loc - x);
if (Match_Distance == 0) {
// Dodge divide by zero error.
return proximity == ... | java |
protected static Map<Character, Integer> match_alphabet(String pattern) {
Map<Character, Integer> s = new HashMap<Character, Integer>();
char[] char_pattern = pattern.toCharArray();
for (char c : char_pattern) {
s.put(c, 0);
}
int i = 0;
for (char c : char_pat... | java |
protected void patch_addContext(Patch patch, String text) {
if (text.length() == 0) {
return;
}
String pattern = text.substring(patch.start2, patch.start2
+ patch.length1);
int padding = 0;
// Look for the first and last matches of pattern in text. If... | java |
public LinkedList<Patch> patch_make(String text1, String text2) {
if (text1 == null || text2 == null) {
throw new IllegalArgumentException("Null inputs. (patch_make)");
}
// No diffs provided, compute our own.
LinkedList<Diff> diffs = diff_main(text1, text2, true);
if... | java |
public LinkedList<Patch> patch_make(LinkedList<Diff> diffs) {
if (diffs == null) {
throw new IllegalArgumentException("Null inputs. (patch_make)");
}
// No origin string provided, compute our own.
String text1 = diff_text1(diffs);
return patch_make(text1, diffs);
... | java |
public LinkedList<Patch> patch_make(String text1, String text2,
LinkedList<Diff> diffs) {
return patch_make(text1, diffs);
} | java |
public LinkedList<Patch> patch_deepCopy(LinkedList<Patch> patches) {
LinkedList<Patch> patchesCopy = new LinkedList<Patch>();
for (Patch aPatch : patches) {
Patch patchCopy = new Patch();
for (Diff aDiff : aPatch.diffs) {
Diff diffCopy = new Diff(aDiff.operation, ... | java |
public String patch_addPadding(LinkedList<Patch> patches) {
short paddingLength = Patch_Margin;
String nullPadding = "";
for (short x = 1; x <= paddingLength; x++) {
nullPadding += String.valueOf((char) x);
}
// Bump all the patches forward.
for (Patch aPatch... | java |
public String patch_toText(List<Patch> patches) {
StringBuilder text = new StringBuilder();
for (Patch aPatch : patches) {
text.append(aPatch);
}
return text.toString();
} | java |
private static String unescapeForEncodeUriCompatability(String str) {
return str.replace("%21", "!").replace("%7E", "~").replace("%27", "'")
.replace("%28", "(").replace("%29", ")").replace("%3B", ";")
.replace("%2F", "/").replace("%3F", "?").replace("%3A", ":")
.... | java |
public List<java.lang.Object> getPubmedArticleOrPubmedBookArticle() {
if (pubmedArticleOrPubmedBookArticle == null) {
pubmedArticleOrPubmedBookArticle = new ArrayList<java.lang.Object>();
}
return this.pubmedArticleOrPubmedBookArticle;
} | java |
public String getISSN() {
if (Journal_Type.featOkTst && ((Journal_Type)jcasType).casFeat_ISSN == null)
jcasType.jcas.throwFeatMissing("ISSN", "de.julielab.jules.types.Journal");
return jcasType.ll_cas.ll_getStringValue(addr, ((Journal_Type)jcasType).casFeatCode_ISSN);} | java |
public void setISSN(String v) {
if (Journal_Type.featOkTst && ((Journal_Type)jcasType).casFeat_ISSN == null)
jcasType.jcas.throwFeatMissing("ISSN", "de.julielab.jules.types.Journal");
jcasType.ll_cas.ll_setStringValue(addr, ((Journal_Type)jcasType).casFeatCode_ISSN, v);} | java |
public String getVolume() {
if (Journal_Type.featOkTst && ((Journal_Type)jcasType).casFeat_volume == null)
jcasType.jcas.throwFeatMissing("volume", "de.julielab.jules.types.Journal");
return jcasType.ll_cas.ll_getStringValue(addr, ((Journal_Type)jcasType).casFeatCode_volume);} | java |
public void setVolume(String v) {
if (Journal_Type.featOkTst && ((Journal_Type)jcasType).casFeat_volume == null)
jcasType.jcas.throwFeatMissing("volume", "de.julielab.jules.types.Journal");
jcasType.ll_cas.ll_setStringValue(addr, ((Journal_Type)jcasType).casFeatCode_volume, v);} | java |
public String getTitle() {
if (Journal_Type.featOkTst && ((Journal_Type)jcasType).casFeat_title == null)
jcasType.jcas.throwFeatMissing("title", "de.julielab.jules.types.Journal");
return jcasType.ll_cas.ll_getStringValue(addr, ((Journal_Type)jcasType).casFeatCode_title);} | java |
public void setTitle(String v) {
if (Journal_Type.featOkTst && ((Journal_Type)jcasType).casFeat_title == null)
jcasType.jcas.throwFeatMissing("title", "de.julielab.jules.types.Journal");
jcasType.ll_cas.ll_setStringValue(addr, ((Journal_Type)jcasType).casFeatCode_title, v);} | java |
public String getImpactFactor() {
if (Journal_Type.featOkTst && ((Journal_Type)jcasType).casFeat_impactFactor == null)
jcasType.jcas.throwFeatMissing("impactFactor", "de.julielab.jules.types.Journal");
return jcasType.ll_cas.ll_getStringValue(addr, ((Journal_Type)jcasType).casFeatCode_impactFactor);} | java |
public void setImpactFactor(String v) {
if (Journal_Type.featOkTst && ((Journal_Type)jcasType).casFeat_impactFactor == null)
jcasType.jcas.throwFeatMissing("impactFactor", "de.julielab.jules.types.Journal");
jcasType.ll_cas.ll_setStringValue(addr, ((Journal_Type)jcasType).casFeatCode_impactFactor, v);} | java |
public String getIssue() {
if (Journal_Type.featOkTst && ((Journal_Type)jcasType).casFeat_issue == null)
jcasType.jcas.throwFeatMissing("issue", "de.julielab.jules.types.Journal");
return jcasType.ll_cas.ll_getStringValue(addr, ((Journal_Type)jcasType).casFeatCode_issue);} | java |
public void setIssue(String v) {
if (Journal_Type.featOkTst && ((Journal_Type)jcasType).casFeat_issue == null)
jcasType.jcas.throwFeatMissing("issue", "de.julielab.jules.types.Journal");
jcasType.ll_cas.ll_setStringValue(addr, ((Journal_Type)jcasType).casFeatCode_issue, v);} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.