congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Quantity.setEnd
Code IndexAdd Tabnine to your IDE (free)

How to use
setEnd
method
in
uk.gov.dstl.baleen.types.common.Quantity

Best Java code snippets using uk.gov.dstl.baleen.types.common.Quantity.setEnd (Showing top 8 results out of 315)

origin: uk.gov.dstl.baleen/baleen-uima

/**
 * @generated
 * @param jcas JCas to which this Feature Structure belongs
 * @param begin offset to the begin spot in the SofA
 * @param end offset to the end spot in the SofA
 */
public Quantity(JCas jcas, int begin, int end) {
 super(jcas);
 setBegin(begin);
 setEnd(end);
 readObject();
}
origin: dstl/baleen

/**
 * @generated
 * @param jcas JCas to which this Feature Structure belongs
 * @param begin offset to the begin spot in the SofA
 * @param end offset to the end spot in the SofA
 */
public Quantity(JCas jcas, int begin, int end) {
 super(jcas);
 setBegin(begin);
 setEnd(end);
 readObject();
}
origin: dstl/baleen

@Test
public void testRemoveQuantity() throws UIMAException {
 jCas.setDocumentText("The weapons were found 20 miles north of London");
 Quantity q = new Quantity(jCas);
 q.setBegin(23);
 q.setEnd(31);
 q.setSubType("distance");
 q.addToIndexes();
 Location l = new Location(jCas, 41, 47);
 l.addToIndexes();
 processJCas(ExpandLocationToDescription.PARAM_REMOVE_QUANTITY, true);
 assertEquals("20 miles north of London", l.getCoveredText());
 assertEquals(0, JCasUtil.select(jCas, Quantity.class).size());
}
origin: dstl/baleen

@Test
public void test() throws UIMAException {
 jCas.setDocumentText("The weapons were found 50 miles south-west of London");
 Quantity q = new Quantity(jCas);
 q.setBegin(23);
 q.setEnd(31);
 q.setSubType("distance");
 q.addToIndexes();
 Location l = new Location(jCas, 46, 52);
 l.addToIndexes();
 processJCas();
 assertEquals("50 miles south-west of London", l.getCoveredText());
 assertEquals(1, JCasUtil.select(jCas, Quantity.class).size());
}
origin: dstl/baleen

 @Test
 public void testMarked() throws UIMAException {
  Quantity q = new Quantity(jCas);
  q.setBegin(18);
  q.setEnd(21);
  q.addToIndexes();

  Buzzword e = new Buzzword(jCas);
  e.setBegin(25);
  e.setEnd(36);
  e.addToIndexes();

  processJCas();

  assertEquals(2, JCasUtil.select(jCas, Entity.class).size());

  assertEquals(1, JCasUtil.select(jCas, Relation.class).size());
  Relation r = JCasUtil.selectByIndex(jCas, Relation.class, 0);
  assertEquals(18, r.getBegin());
  assertEquals(q, r.getSource());
  assertEquals(36, e.getEnd());
  assertEquals(e, r.getTarget());
  assertEquals("QUANTITY", r.getRelationshipType());
 }
}
origin: dstl/baleen

@Test
public void testUnmarked() throws UIMAException {
 Quantity q = new Quantity(jCas);
 q.setBegin(18);
 q.setEnd(21);
 q.addToIndexes();
 processJCas();
 assertAnnotations(2, Entity.class, new TestEntity<>(1, "blue powder"));
 assertEquals(1, JCasUtil.select(jCas, Relation.class).size());
 Relation r = JCasUtil.selectByIndex(jCas, Relation.class, 0);
 assertEquals(18, r.getBegin());
 assertEquals(q, r.getSource());
 assertEquals(36, r.getEnd());
 assertNotNull(r.getTarget());
 assertEquals("QUANTITY", r.getRelationshipType());
}
origin: dstl/baleen

public static Quantity createDistanceQuantity(
  JCas jCas,
  int begin,
  int end,
  String value,
  int quantity,
  String unit,
  double normalizedQuantity) {
 Quantity q = new Quantity(jCas);
 q.setBegin(begin);
 q.setEnd(end);
 q.setConfidence(1.0);
 q.setValue(value);
 q.setQuantity(quantity);
 q.setUnit(unit);
 q.setNormalizedQuantity(normalizedQuantity);
 q.setNormalizedUnit("m");
 q.setSubType("length");
 q.addToIndexes();
 return q;
}
origin: dstl/baleen

public static Quantity createWeightQuantity(
  JCas jCas,
  int begin,
  int end,
  String value,
  double quantity,
  String unit,
  double normalizedQuantity) {
 Quantity q = new Quantity(jCas);
 q.setBegin(begin);
 q.setEnd(end);
 q.setConfidence(1.0);
 q.setValue(value);
 q.setQuantity(quantity);
 q.setUnit(unit);
 q.setNormalizedQuantity(normalizedQuantity);
 q.setNormalizedUnit("kg");
 q.setSubType(WEIGHT);
 q.addToIndexes();
 return q;
}
uk.gov.dstl.baleen.types.commonQuantitysetEnd

Popular methods of Quantity

  • <init>
  • addToIndexes
  • setBegin
  • getBegin
  • getCoveredText
  • getEnd
  • getNormalizedQuantity
    getter for normalizedQuantity - gets The normalized quantity
  • getNormalizedUnit
    getter for normalizedUnit - gets The unit of the normalized quantity
  • getQuantity
    getter for quantity - gets The raw quantity
  • getSubType
  • getUnit
    getter for unit - gets The unit of the raw quantity
  • getValue
  • getUnit,
  • getValue,
  • readObject,
  • setConfidence,
  • setNormalizedQuantity,
  • setNormalizedUnit,
  • setQuantity,
  • setSubType,
  • setUnit

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Runner (org.openjdk.jmh.runner)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now