@@ -92,10 +92,7 @@ public class Kanban {
9292
9393 // the primary kanban elements indexed by their IDs
9494 private Map <String , Board > boards = new HashMap <String , Board >();
95- //private Map<String, CardList> lists = new HashMap<String, CardList>();
96- //private Map<String, Card> cards = new HashMap<String, Card>();
9795 private Map <String , KanbanSentence > sentences = new HashMap <String , KanbanSentence >();
98- //private Map<String, RawText> rawTexts = new HashMap<String, RawText>();
9996
10097 // sentences indexed by their content and board to avoid duplicates
10198 private Map <String , KanbanSentence > sentencesByText = new HashMap <String , KanbanSentence >();
@@ -161,9 +158,9 @@ public Kanban(Howler howler, String configPath) {
161158
162159 }
163160
164- //added a board -> create an ontology
161+ // added a board -> create an ontology
165162 public void addBoard (Board board ) {
166-
163+
167164 this .boards .put (board .getId (), board );
168165 LOGGER .info ("Added Board:" + board .getTitle ());
169166
@@ -190,52 +187,16 @@ public void addBoard(Board board) {
190187 }
191188
192189 }
193- /*
194- * private Board getBoard(String id) { return this.boards.get(id); }
195- */
196-
190+
197191 public void addList (CardList list ) {
198192 // add the list to the board it is part of
199193 this .boards .get (list .getBoardId ()).addList (list );
200- LOGGER .info ("Added List:" + list .getTitle () + " to board " + this .boards .get (list .getBoardId ()).getTitle () );
201- }
202-
203- /*
204- * private CardList getList(String id) { return this.lists.get(id); }
205- */
206- /*
207- public void addCard(Card card) {
208- // this.cards.put(card.get_id(), card);
209- // add the card to the board it is part of
210- boards.get(card.getBoardId()).addCard(card);
211- this.cardsByKey.put(card.getKey(), card);
212- // add the card to the list it is part of
213- lists.get(card.getListId()).addCard(card);
214- LOGGER.info("Added Card:" + card.getTitle());
194+ LOGGER .info ("Added List:" + list .getTitle () + " to board " + this .boards .get (list .getBoardId ()).getTitle ());
215195 }
216- */
217- /*
218- * private Card getCard(String id) { return this.cards.get(id); } private Card getCardByKey(String key) { return
219- * this.cardsByKey.get(key); } private KanbanSentence getSentence(String id) { return sentences.get(id); }
220- */
221- /*
222- private void addSentence(KanbanSentence sentence) {
223-
224- LOGGER.info("Added Sentence:" + sentence.getText());
225- // create any cards needed to match words used in sentence
226- this.addCards(sentence);
227- // create axiom(s) that corresponds to sentence and add to ontology
228- this.addAxioms(sentence);
229196
230- }
231- */
232-
233- /*
234- * private RawText getRawText(String id) { return rawTexts.get(id); }
235- */
236197 public void addRawText (RawText rawText ) {
237198
238- //rawTexts.put(rawText.get_id(), rawText);
199+ // rawTexts.put(rawText.get_id(), rawText);
239200
240201 // rawtext to abstraction Document
241202 Document doc = howler .convertText ("dummy" , rawText .getText ());
@@ -279,7 +240,8 @@ public void addRawText(RawText rawText) {
279240 for (Word w : sent .getWords ()) {
280241 WordType wt = w .getWordType ();
281242 // dont create cards for generic, quantifiers or WordTypes
282- if (!wt .equals (WordType .GENERIC_WORD ) && !wt .equals (WordType .QUANTIFIER ) && !wt .equals (WordType .NEGATIVE ) && !wt .equals (WordType .WORD_TYPE )) {
243+ if (!wt .equals (WordType .GENERIC_WORD ) && !wt .equals (WordType .QUANTIFIER ) && !wt .equals (WordType .NEGATIVE )
244+ && !wt .equals (WordType .WORD_TYPE )) {
283245 if (w instanceof Predicate ) {
284246 Predicate pred = (Predicate ) w ;
285247 // don't create card for builtin predicates
@@ -296,21 +258,19 @@ public void addRawText(RawText rawText) {
296258 this .addCard (wrd , rawText .getBoardId (), rawText .getSwimlaneId (), rawText .getUserId ());
297259 kbSent .addKey (wrd .getKey ().toString ());
298260 }
299-
261+
300262 // add sentence to index
301263 this .sentences .put (kbSent .get_id (), kbSent );
302-
264+
303265 // add inferences
304266 this .addAxioms (kbSent );
305-
267+
306268 kbSents .add (kbSent );
307269 }
308270
309271 // send the sentences to the Wekan system
310272 this .sendSentences (kbSents , false );
311273
312-
313-
314274 // remove the rawtext
315275 client .collectionDelete ("rawtext" , rawText .get_id ());
316276
@@ -328,11 +288,6 @@ private void addToOntology(Document doc, OWLOntology onto) {
328288
329289 }
330290
331- /*
332- private boolean isSynched() {
333- return synched;
334- }
335- */
336291 private void setSynched (boolean synched ) {
337292 this .synched = synched ;
338293 if (synched ) {
@@ -437,49 +392,6 @@ private void addCard(Word wrd, String boardID, String swimlaneID, String userID)
437392
438393 }
439394
440- /*
441- // create any new cards needed to represent words used in the sentence
442- private void addCards(KanbanSentence sent) {
443-
444- String userID = sent.getUserId();
445- String boardID = sent.getBoardId();
446-
447- for (String key : sent.getKeys()) {
448-
449- // seen key before?
450- if (!this.cardsByKey.keySet().contains(key)) {
451-
452- // keys look like:logicalForm|WordType|boardID
453- String[] pieces = key.split("\\|");
454-
455- // title is the words logical form with part of speech following
456- String title = pieces[0].replaceAll("_", " ") + " (" + pieces[1].toLowerCase() + ")";
457-
458- // create and populate new card
459- Card card = new Card();
460-
461- card.setTitle(title);
462- card.setKey(key);
463- card.setEntityType(WordType.valueOf(pieces[1]));
464- card.setBoardId(boardID);
465- // TODO list selected is first list in board. Better choice?
466- card.setListId(boards.get(boardID).getLists().get(0).getId());
467- card.setUserid(userID);
468-
469- // create field map and send to Wekan
470- String json = gson.toJson(card);
471- Map<String, Object> fields = gson.fromJson(json, Map.class);
472-
473- int id = client.collectionInsert("cards", fields);
474- LOGGER.info("Inserting new Card. ID=" + id + ". " + card.getTitle());
475-
476- this.cardsByKey.put(key, card);
477- }
478-
479- }
480- }
481- */
482-
483395 // create a axiom(s) from a sentence and add to appropriate ontology
484396 private void addAxioms (KanbanSentence sent ) {
485397
0 commit comments