GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — RepGraph/src/main/java/com/RepGraph/PTGGraph.java at main · RepGraph/RepGraph

Expand file tree

/

PTGGraph.java

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
58 lines (44 loc) · 1.63 KB
/

PTGGraph.java

Copy path

File metadata and controls

58 lines (44 loc) · 1.63 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.RepGraph;
import com.fasterxml.jackson.annotation.JsonSetter;
import java.util.ArrayList;
import java.util.HashMap;
/**
* The PTG Graph class represents a graph following the PTG Framework
*/
public class PTGGraph extends AbstractGraph {
public PTGGraph() {
super();
}
public PTGGraph(String id, String source, String input, HashMap<String, Node> nodes, ArrayList<Token> tokens, ArrayList<Edge> edges, String top) {
super(id, source, input, nodes, edges,tokens, top);
}
/**
* Sets the nodes hashmap from an array of node objects - uses PTG specific rules
* @param nodelist Array of Node objects
*/
@JsonSetter("nodes")
public void setNodes(ArrayList<Node> nodelist) {
for (Node n : nodelist) {
ArrayList<Anchors> characterSpans = null;
if (n.getAnchors()!=null){
characterSpans = new ArrayList<>();
for (Anchors a:n.getAnchors()) {
Anchors AnchChar = new Anchors(a.getFrom(),a.getEnd());
characterSpans.add(AnchChar);
}}
n.setCharacterSpans(characterSpans);
if (n.getLabel()!=null){
if (n.getLabel().startsWith("#")){
n.setSurface(false);
}else{n.setSurface(true);}
}
this.nodes.put(n.getId(), n);
}
ArrayList<Anchors> anchArr = new ArrayList<>();
Anchors anchors = new Anchors(0,this.input.length());
anchArr.add(anchors);
this.nodes.get("0").setAnchors(anchArr);
this.nodes.get("0").setLabel("#0");
populateTokens();
}
}
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.