Package edu.stanford.nlp.ling

Examples of edu.stanford.nlp.ling.MultiTokenTag$Tag


   * Test writing of a Node element with no user.
   */
  @Test
  public final void testProcessNodeWithNoUser() {
    Node node = new Node(new CommonEntityData(1234, 2, timestamp, OsmUser.NONE, 0), 20.12345678, -21.98765432);
    node.getTags().add(new Tag("nodekey", "nodevalue"));
    testNodeWriter.process(node);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here


   */
  @Override
  public void processRow(ResultSet resultSet) throws SQLException {
        String key;
        String value;
        Tag tag;
       
    key = resultSet.getString("k");
    value = resultSet.getString("v");
   
    tag = new Tag(key, value);
   
        listener.process(tag, resultSet);
  }
View Full Code Here

    }

    // Replace the entity tags with the transformed values.
    entityTags.clear();
    for (Entry<String, String> tag : tagMap.entrySet()) {
      entityTags.add(new Tag(tag.getKey(), tag.getValue()));
    }

    return writeableEntityContainer;
  }
View Full Code Here

      user = new OsmUser(10, "user10b");
     
      // Modify node 1 to add a new tag.
      node = nodeManager.getEntity(1).getWriteableInstance();
      node.setUser(user);
      node.getTags().add(new Tag("change", "new tag"));
      nodeManager.modifyEntity(node);
     
      // Delete node 6.
      nodeManager.removeEntity(6);
     
      // Add node 7 using the NONE user.
      node = new Node(new CommonEntityData(7, 16, buildDate("2008-01-02 18:19:20"), OsmUser.NONE, 93), -11, -12);
      node.getTags().addAll(
          Arrays.asList(new Tag[]{new Tag("created_by", "Me7"), new Tag("change", "new node")}));
      nodeManager.addEntity(node);
     
      dsCtx.complete();
     
    } finally {
View Full Code Here

      user = new OsmUser(10, "user10b");
     
      // Modify node 1 to add a new tag.
      node = nodeManager.getEntity(1).getWriteableInstance();
      node.setUser(user);
      node.getTags().add(new Tag("change", "new tag"));
      nodeManager.modifyEntity(node);
     
      // Delete node 6.
      nodeManager.removeEntity(6);
     
      // Add node 7 using the NONE user.
      node = new Node(new CommonEntityData(7, 16, buildDate("2008-01-02 18:19:20"), OsmUser.NONE, 93), -11, -12);
      node.getTags().addAll(
          Arrays.asList(new Tag[]{new Tag("created_by", "Me7"), new Tag("change", "new node")}));
      nodeManager.addEntity(node);
     
      dsCtx.complete();
     
    } finally {
View Full Code Here

    @Override
    protected void parseNodes(List<Osmformat.Node> nodes) {
      for (Osmformat.Node i : nodes) {
        List<Tag> tags = new ArrayList<Tag>();
        for (int j = 0; j < i.getKeysCount(); j++) {
          tags.add(new Tag(getStringById(i.getKeys(j)), getStringById(i.getVals(j))));
        }
        // long id, int version, Date timestamp, OsmUser user,
        // long changesetId, Collection<Tag> tags,
        // double latitude, double longitude
        Node tmp;
View Full Code Here

            // If empty, assume that nothing here has keys or vals.
            if (nodes.getKeysValsCount() > 0) {
                while (nodes.getKeysVals(j) != 0) {
                    int keyid = nodes.getKeysVals(j++);
                    int valid = nodes.getKeysVals(j++);
                    tags.add(new Tag(getStringById(keyid), getStringById(valid)));
                }
                j++; // Skip over the '0' delimiter.
            }
            // Handle dense info.
            if (di != null) {
View Full Code Here

    @Override
    protected void parseWays(List<Osmformat.Way> ways) {
        for (Osmformat.Way i : ways) {
            List<Tag> tags = new ArrayList<Tag>();
            for (int j = 0; j < i.getKeysCount(); j++) {
                tags.add(new Tag(getStringById(i.getKeys(j)), getStringById(i.getVals(j))));
            }
               
            long lastId = 0;
            List<WayNode> nodes = new ArrayList<WayNode>();
            for (long j : i.getRefsList()) {
View Full Code Here

    @Override
    protected void parseRelations(List<Osmformat.Relation> rels) {
        for (Osmformat.Relation i : rels) {
            List<Tag> tags = new ArrayList<Tag>();
            for (int j = 0; j < i.getKeysCount(); j++) {
                tags.add(new Tag(getStringById(i.getKeys(j)), getStringById(i.getVals(j))));
            }

            long id = i.getId();

            long lastMid = 0;
View Full Code Here

    String value;
   
    key = attributes.getValue(ATTRIBUTE_NAME_KEY);
    value = attributes.getValue(ATTRIBUTE_NAME_VALUE);
   
    tag = new Tag(key, value);
  }
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.ling.MultiTokenTag$Tag

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.