1 #ifndef _WORDGRAPH_H
2 #define _WORDGRAPH_H
3 
4 #include "api-structures.h"
5 
6 #ifdef USE_WORDGRAPH_DISPLAY
7 /* Wordgraph display representation modes. */
8 #define lo(l) (l-'a')
9 #define WGR_SUB      (1<<lo('s')) /* Unsplit words as subgraphs */
10 #define WGR_COMPACT  (1<<lo('c')) /* Compact. Just now applies only to 's'. */
11 #define WGR_PREV     (1<<lo('p')) /* Prev links */
12 #define WGR_UNSPLIT  (1<<lo('u')) /* Unsplit_word links */
13 #define WGR_DBGLABEL (1<<lo('d')) /* Debug label addition */
14 #define WGR_DOTDEBUG (1<<lo('h')) /* Hex node numbers, for dot commands debug */
15 #define WGR_LEGEND   (1<<lo('l')) /* Add a legend */
16 #define WGR_X11      (1<<lo('x')) /* Display using X11 even on Windows */
17 #endif /* USE_WORDGRAPH_DISPLAY */
18 
19 /* Original sentence words have their unsplit_word set to the wordgraph
20  * start. See issue_sentence_word. */
21 #define IS_SENTENCE_WORD(sent, gword) (gword->unsplit_word == sent->wordgraph)
22 
23 Gword *gword_new(Sentence, const char *);
24 size_t gwordlist_len(const Gword **);
25 void gwordlist_append(Gword ***, Gword *);
26 void gword_set_print(const gword_set *);
27 void print_lwg_path(Gword **, const char *);
28 Gword *wg_get_sentence_word(const Sentence, Gword *);
29 #if 0
30 void gwordlist_append_list(const Gword ***, const Gword **);
31 #endif
32 
33 const Gword **wordgraph_hier_position(Gword *);
34 void print_hier_position(const Gword *);
35 bool in_same_alternative(Gword *, Gword *);
36 Gword *find_real_unsplit_word(Gword *, bool);
37 
38 size_t wordgraph_pathpos_len(Wordgraph_pathpos *);
39 Wordgraph_pathpos *wordgraph_pathpos_resize(Wordgraph_pathpos *, size_t);
40 bool wordgraph_pathpos_add(Wordgraph_pathpos **, Gword *, bool, bool, bool);
41 
42 const char *gword_status(Sentence, const Gword *);
43 const char *gword_morpheme(Sentence sent, const Gword *w);
44 #endif /* _WORDGRAPH_H */
45