Package org.emftrace.quarc.core.conditions

Examples of org.emftrace.quarc.core.conditions.NGramCheckEObjectCondition


          showPendingItem();

          NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
              n, filter, minCorrelation, true, true);

          NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
              ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
              nGramCheckCondition, cataloguge);

          NGramCheckEObjectCondition condition2 = new NGramCheckEObjectCondition(
              ConstraintsPackage.eINSTANCE
                  .getTechnicalProperty_Description(),
              nGramCheckCondition, cataloguge);

          NGramCheckEObjectCondition condition3 = new NGramCheckEObjectCondition(
              ConstraintsPackage.eINSTANCE
                  .getTechnicalProperty_Alias(),
              nGramCheckCondition, cataloguge);

          List<EObject> exclude = new ArrayList<EObject>();
          for (Constraint assignedConstraint : assignedConstraintedSet
              .getAssignedConstraints())
            exclude.add(assignedConstraint.getTechnicalProperty());

          EObjectCondition condition0 = new ExcludeEObjectCondition(
              exclude);

          SELECT statement = new SELECT(new FROM(cataloguge
              .getCatalogueProperties()), new WHERE(condition0
              .AND(condition1.OR(condition2.OR(condition3)))));
          for (Object object : statement.execute()) {
            addTreeItem((TechnicalProperty) object);

          }

          matchesMap.putAll(condition1.getHits());
          mergeHits(matchesMap, condition2.getHits());
          mergeHits(matchesMap, condition3.getHits());

          filteredContentProviderResultItemMap.clear();

          for (Entry<EObject, HashMap<String, HashMap<String, Integer>>> entry : matchesMap
              .entrySet()) {
View Full Code Here


    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "foo", 0.8f, true, true);

    NGramCheckEObjectCondition condition = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );

    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition));
   
    IQueryResult result = statement.execute();

    assertTrue( result.contains(tp1));
    assertFalse( result.contains(tp2));
   
    assertEquals(1, result.size());
   
    assertTrue(condition.getHits().containsKey(tp1));
    assertFalse(condition.getHits().containsKey(tp2));
   
    assertTrue(condition.getHits().get(tp1).containsKey("name"));
    System.out.println(" "+condition.getHits().get(tp1).get("name"));
   
   
    assertTrue(condition.getHits().get(tp1).get("name").containsKey("foo"));
    assertEquals((Integer) 1, condition.getHits().get(tp1).get("name").get("foo"));
   
  }
View Full Code Here

    catalogue.getCatalogueProperties().add(tp5);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "bar", 0.8f, true, true);

    NGramCheckEObjectCondition condition = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );


    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition));
   
    IQueryResult result = statement.execute();
   
    assertTrue( result.contains(tp2));
    assertFalse( result.contains(tp1));
   
    assertEquals(1, result.size());
   
    assertTrue(condition.getHits().containsKey(tp2));
    assertFalse(condition.getHits().containsKey(tp1));
   
    assertTrue(condition.getHits().get(tp2).containsKey("name"));
    assertTrue(condition.getHits().get(tp2).get("name").containsKey("bar"));
    assertEquals((Integer) 1, condition.getHits().get(tp2).get("name").get("bar"));
   
  }
View Full Code Here

    cat.getEntries().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "cat", 0.8f, true, true);

    NGramCheckEObjectCondition condition = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );

    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition));
   
    IQueryResult result = statement.execute();

    assertTrue( result.contains(cat));
    assertTrue( result.contains(tp1));
    assertTrue( result.contains(tp2));
   
    assertEquals(3, result.size());
   
    assertTrue(condition.getHits().containsKey(cat));
    assertTrue(condition.getHits().get(cat).containsKey("name"));
    assertTrue(condition.getHits().get(cat).get("name").containsKey("cat"));
    assertEquals((Integer) 1, condition.getHits().get(cat).get("name").get("cat"));
   
    assertTrue(condition.getHits().containsKey(tp1));
    assertTrue(condition.getHits().get(tp1).containsKey("name"));
    assertTrue(condition.getHits().get(tp1).get("name").containsKey("cat"));
    assertEquals((Integer) 1, condition.getHits().get(tp1).get("name").get("cat"));
   
    assertTrue(condition.getHits().containsKey(tp2));
    assertTrue(condition.getHits().get(tp2).containsKey("name"));
    assertTrue(condition.getHits().get(tp2).get("name").containsKey("cat"));
    assertEquals((Integer) 1, condition.getHits().get(tp2).get("name").get("cat"));
  }
View Full Code Here

    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "foo", 0.8f, true, true);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );
   
    List<EObject> excludeList = new ArrayList<EObject>();
    excludeList.add(tp2);
    ExcludeEObjectCondition condition0 = new ExcludeEObjectCondition(excludeList);


    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition1.AND(condition0)));
   
    IQueryResult result = statement.execute();
   

   
View Full Code Here

    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "foo", 0.8f, true, true);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );
   
    List<EObject> excludeList = new ArrayList<EObject>();

    ExcludeEObjectCondition condition0 = new ExcludeEObjectCondition(excludeList);


    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition1.AND(condition0)));
   
    IQueryResult result = statement.execute();
   

   
View Full Code Here

    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "foo", 0.8f, true, true);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );


    SELECT statement = new SELECT(new FROM(catalogue
View Full Code Here

    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, null, 0.8f, true, true);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );


    SELECT statement = new SELECT(new FROM(catalogue
View Full Code Here

    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, null, 0.8f, true, false);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );

    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition1));
View Full Code Here

    catalogue.getCatalogueProperties().add(tp2);
   
    NGramCheckCondition nGramCheckCondition = new NGramCheckCondition(
        3, "foo", 0.8f, true, true);

    NGramCheckEObjectCondition condition1 = new NGramCheckEObjectCondition(
        ConstraintsPackage.eINSTANCE.getTechnicalProperty_Name(),
        nGramCheckCondition,catalogue );

    SELECT statement = new SELECT(new FROM(catalogue
        .getCatalogueProperties()), new WHERE(condition1));
View Full Code Here

TOP

Related Classes of org.emftrace.quarc.core.conditions.NGramCheckEObjectCondition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.