Created
November 2, 2013 22:05
-
-
Save baojie/7284019 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
To install pylinkgrammar on Ubuntu | |
sudo apt-get install liblink-grammar4-dev cmake swig | |
pip install pylinkgrammar | |
""" | |
from pylinkgrammar.linkgrammar import Parser | |
from time import time | |
def run(f): | |
start_time = time() | |
f() | |
print time() - start_time, "seconds" | |
def parse_sample(file_name): | |
total_success = 0 | |
questions = open(file_name) | |
for i, q in enumerate(questions): | |
# rebuild the parser for every 50 calls | |
# seems there is a memory leak in their implementation | |
if (i % 50 == 0): p = Parser() | |
print i+1,")", | |
print q | |
try: | |
linkages = p.parse_sent(q) | |
print(linkages[0].diagram) | |
total_success +=1 | |
except Exception as e: | |
print "[Parsing Error]", e | |
questions.close() | |
print "Total success: ", total_success | |
def main(): | |
parse_sample("sentences.txt") | |
if __name__=="__main__": | |
run(main) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got the following error trying to install pylinkgrammar
Building wheels for collected packages: pylinkgrammar
Building wheel for pylinkgrammar (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [357 lines of output]
INFO: Disabling color, you really want to install colorlog.
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_dictionary_create’:
pylinkgrammar/link_grammar_wrap.c:3397:24: warning: implicit declaration of function ‘dictionary_create’; did you mean ‘dictionary_delete’? [-Wimplicit-function-declaration]
3397 | result = (Dictionary)dictionary_create(arg1,arg2,arg3,arg4);
| ^~~~~~~~~~~~~~~~~
| dictionary_delete
pylinkgrammar/link_grammar_wrap.c:3397:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
3397 | result = (Dictionary)dictionary_create(arg1,arg2,arg3,arg4);
| ^
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_dictionary_delete’:
pylinkgrammar/link_grammar_wrap.c:3467:12: error: invalid use of void expression
3467 | result = (int)dictionary_delete(arg1);
| ^
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_dictionary_get_max_cost’:
pylinkgrammar/link_grammar_wrap.c:3490:17: warning: implicit declaration of function ‘dictionary_get_max_cost’; did you mean ‘_wrap_dictionary_get_max_cost’? [-Wimplicit-function-declaration]
3490 | result = (int)dictionary_get_max_cost(arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~
| _wrap_dictionary_get_max_cost
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_dictionary_is_past_tense_form’:
pylinkgrammar/link_grammar_wrap.c:3559:17: warning: implicit declaration of function ‘dictionary_is_past_tense_form’; did you mean ‘_wrap_dictionary_is_past_tense_form’? [-Wimplicit-function-declaration]
3559 | result = (int)dictionary_is_past_tense_form(arg1,(char const *)arg2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_dictionary_is_past_tense_form
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_dictionary_is_entity’:
pylinkgrammar/link_grammar_wrap.c:3592:17: warning: implicit declaration of function ‘dictionary_is_entity’; did you mean ‘_wrap_dictionary_is_entity’? [-Wimplicit-function-declaration]
3592 | result = (int)dictionary_is_entity(arg1,(char const *)arg2);
| ^~~~~~~~~~~~~~~~~~~~
| _wrap_dictionary_is_entity
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_parse_options_set_null_block’:
pylinkgrammar/link_grammar_wrap.c:3919:3: warning: implicit declaration of function ‘parse_options_set_null_block’; did you mean ‘_wrap_parse_options_set_null_block’? [-Wimplicit-function-declaration]
3919 | parse_options_set_null_block(arg1,arg2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_parse_options_set_null_block
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_parse_options_get_null_block’:
pylinkgrammar/link_grammar_wrap.c:3942:17: warning: implicit declaration of function ‘parse_options_get_null_block’; did you mean ‘_wrap_parse_options_get_null_block’? [-Wimplicit-function-declaration]
3942 | result = (int)parse_options_get_null_block(arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_parse_options_get_null_block
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_parse_options_set_max_sentence_length’:
pylinkgrammar/link_grammar_wrap.c:4127:3: warning: implicit declaration of function ‘parse_options_set_max_sentence_length’; did you mean ‘_wrap_parse_options_set_max_sentence_length’? [-Wimplicit-function-declaration]
4127 | parse_options_set_max_sentence_length(arg1,arg2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_parse_options_set_max_sentence_length
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_parse_options_get_max_sentence_length’:
pylinkgrammar/link_grammar_wrap.c:4150:17: warning: implicit declaration of function ‘parse_options_get_max_sentence_length’; did you mean ‘_wrap_parse_options_get_max_sentence_length’? [-Wimplicit-function-declaration]
4150 | result = (int)parse_options_get_max_sentence_length(arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_parse_options_get_max_sentence_length
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_parse_options_set_screen_width’:
pylinkgrammar/link_grammar_wrap.c:4352:3: warning: implicit declaration of function ‘parse_options_set_screen_width’; did you mean ‘_wrap_parse_options_set_screen_width’? [-Wimplicit-function-declaration]
4352 | parse_options_set_screen_width(arg1,arg2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_parse_options_set_screen_width
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_parse_options_get_screen_width’:
pylinkgrammar/link_grammar_wrap.c:4375:17: warning: implicit declaration of function ‘parse_options_get_screen_width’; did you mean ‘_wrap_parse_options_get_screen_width’? [-Wimplicit-function-declaration]
4375 | result = (int)parse_options_get_screen_width(arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_parse_options_get_screen_width
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_parse_options_set_allow_null’:
pylinkgrammar/link_grammar_wrap.c:4404:3: warning: implicit declaration of function ‘parse_options_set_allow_null’; did you mean ‘_wrap_parse_options_set_allow_null’? [-Wimplicit-function-declaration]
4404 | parse_options_set_allow_null(arg1,arg2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_parse_options_set_allow_null
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_parse_options_get_allow_null’:
pylinkgrammar/link_grammar_wrap.c:4427:17: warning: implicit declaration of function ‘parse_options_get_allow_null’; did you mean ‘_wrap_parse_options_get_allow_null’? [-Wimplicit-function-declaration]
4427 | result = (int)parse_options_get_allow_null(arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_parse_options_get_allow_null
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_parse_options_set_display_walls’:
pylinkgrammar/link_grammar_wrap.c:4456:3: warning: implicit declaration of function ‘parse_options_set_display_walls’; did you mean ‘_wrap_parse_options_set_display_walls’? [-Wimplicit-function-declaration]
4456 | parse_options_set_display_walls(arg1,arg2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_parse_options_set_display_walls
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_parse_options_get_display_walls’:
pylinkgrammar/link_grammar_wrap.c:4479:17: warning: implicit declaration of function ‘parse_options_get_display_walls’; did you mean ‘_wrap_parse_options_get_display_walls’? [-Wimplicit-function-declaration]
4479 | result = (int)parse_options_get_display_walls(arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_parse_options_get_display_walls
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_sentence_get_word’:
pylinkgrammar/link_grammar_wrap.c:4691:20: warning: implicit declaration of function ‘sentence_get_word’; did you mean ‘_wrap_sentence_get_word’? [-Wimplicit-function-declaration]
4691 | result = (char *)sentence_get_word(arg1,arg2);
| ^~~~~~~~~~~~~~~~~
| _wrap_sentence_get_word
pylinkgrammar/link_grammar_wrap.c:4691:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
4691 | result = (char *)sentence_get_word(arg1,arg2);
| ^
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_sentence_and_cost’:
pylinkgrammar/link_grammar_wrap.c:4843:17: warning: implicit declaration of function ‘sentence_and_cost’; did you mean ‘sentence_link_cost’? [-Wimplicit-function-declaration]
4843 | result = (int)sentence_and_cost(arg1,arg2);
| ^~~~~~~~~~~~~~~~~
| sentence_link_cost
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_sentence_get_nth_word’:
pylinkgrammar/link_grammar_wrap.c:4933:20: warning: implicit declaration of function ‘sentence_get_nth_word’; did you mean ‘_wrap_sentence_get_nth_word’? [-Wimplicit-function-declaration]
4933 | result = (char *)sentence_get_nth_word(arg1,arg2);
| ^~~~~~~~~~~~~~~~~~~~~
| _wrap_sentence_get_nth_word
pylinkgrammar/link_grammar_wrap.c:4933:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
4933 | result = (char *)sentence_get_nth_word(arg1,arg2);
| ^
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_sentence_nth_word_has_disjunction’:
pylinkgrammar/link_grammar_wrap.c:4963:17: warning: implicit declaration of function ‘sentence_nth_word_has_disjunction’; did you mean ‘_wrap_sentence_nth_word_has_disjunction’? [-Wimplicit-function-declaration]
4963 | result = (int)sentence_nth_word_has_disjunction(arg1,arg2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_sentence_nth_word_has_disjunction
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_print_diagram’:
pylinkgrammar/link_grammar_wrap.c:5046:20: error: too few arguments to function ‘linkage_print_diagram’
5046 | result = (char *)linkage_print_diagram(arg1);
| ^~~~~~~~~~~~~~~~~~~~~
In file included from pylinkgrammar/link_grammar_wrap.c:3018:
/usr/include/link-grammar/link-includes.h:369:6: note: declared here
369 | linkage_print_diagram(const Linkage lkg, bool display_walls, size_t screen_width);
| ^~~~~~~~~~~~~~~~~~~~~
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_get_current_sublinkage’:
pylinkgrammar/link_grammar_wrap.c:5070:17: warning: implicit declaration of function ‘linkage_get_current_sublinkage’; did you mean ‘_wrap_linkage_get_current_sublinkage’? [-Wimplicit-function-declaration]
5070 | result = (int)linkage_get_current_sublinkage(arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_linkage_get_current_sublinkage
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_set_current_sublinkage’:
pylinkgrammar/link_grammar_wrap.c:5100:17: warning: implicit declaration of function ‘linkage_set_current_sublinkage’; did you mean ‘_wrap_linkage_set_current_sublinkage’? [-Wimplicit-function-declaration]
5100 | result = (int)linkage_set_current_sublinkage(arg1,arg2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_linkage_set_current_sublinkage
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_get_sentence’:
pylinkgrammar/link_grammar_wrap.c:5123:22: warning: implicit declaration of function ‘linkage_get_sentence’; did you mean ‘_wrap_linkage_get_sentence’? [-Wimplicit-function-declaration]
5123 | result = (Sentence)linkage_get_sentence(arg1);
| ^~~~~~~~~~~~~~~~~~~~
| _wrap_linkage_get_sentence
pylinkgrammar/link_grammar_wrap.c:5123:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
5123 | result = (Sentence)linkage_get_sentence(arg1);
| ^
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_get_num_sublinkages’:
pylinkgrammar/link_grammar_wrap.c:5146:17: warning: implicit declaration of function ‘linkage_get_num_sublinkages’; did you mean ‘_wrap_linkage_get_num_sublinkages’? [-Wimplicit-function-declaration]
5146 | result = (int)linkage_get_num_sublinkages(arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_linkage_get_num_sublinkages
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_print_senses’:
pylinkgrammar/link_grammar_wrap.c:5532:20: warning: implicit declaration of function ‘linkage_print_senses’; did you mean ‘linkage_print_pp_msgs’? [-Wimplicit-function-declaration]
5532 | result = (char *)linkage_print_senses(arg1);
| ^~~~~~~~~~~~~~~~~~~~
| linkage_print_pp_msgs
pylinkgrammar/link_grammar_wrap.c:5532:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
5532 | result = (char *)linkage_print_senses(arg1);
| ^
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_print_postscript’:
pylinkgrammar/link_grammar_wrap.c:5593:20: error: too few arguments to function ‘linkage_print_postscript’
5593 | result = (char *)linkage_print_postscript(arg1,arg2);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/link-grammar/link-includes.h:373:6: note: declared here
373 | linkage_print_postscript(const Linkage lkg, bool display_walls, bool print_ps_header);
| ^~~~~~~~~~~~~~~~~~~~~~~~
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_compute_union’:
pylinkgrammar/link_grammar_wrap.c:5617:17: warning: implicit declaration of function ‘linkage_compute_union’; did you mean ‘_wrap_linkage_compute_union’? [-Wimplicit-function-declaration]
5617 | result = (int)linkage_compute_union(arg1);
| ^~~~~~~~~~~~~~~~~~~~~
| _wrap_linkage_compute_union
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_and_cost’:
pylinkgrammar/link_grammar_wrap.c:5686:17: warning: implicit declaration of function ‘linkage_and_cost’; did you mean ‘linkage_link_cost’? [-Wimplicit-function-declaration]
5686 | result = (int)linkage_and_cost(arg1);
| ^~~~~~~~~~~~~~~~
| linkage_link_cost
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_corpus_cost’:
pylinkgrammar/link_grammar_wrap.c:5732:20: warning: implicit declaration of function ‘linkage_corpus_cost’; did you mean ‘_wrap_linkage_corpus_cost’? [-Wimplicit-function-declaration]
5732 | result = (double)linkage_corpus_cost(arg1);
| ^~~~~~~~~~~~~~~~~~~
| _wrap_linkage_corpus_cost
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_is_canonical’:
pylinkgrammar/link_grammar_wrap.c:5755:17: warning: implicit declaration of function ‘linkage_is_canonical’; did you mean ‘_wrap_linkage_is_canonical’? [-Wimplicit-function-declaration]
5755 | result = (int)linkage_is_canonical(arg1);
| ^~~~~~~~~~~~~~~~~~~~
| _wrap_linkage_is_canonical
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_is_improper’:
pylinkgrammar/link_grammar_wrap.c:5778:17: warning: implicit declaration of function ‘linkage_is_improper’; did you mean ‘_wrap_linkage_is_improper’? [-Wimplicit-function-declaration]
5778 | result = (int)linkage_is_improper(arg1);
| ^~~~~~~~~~~~~~~~~~~
| _wrap_linkage_is_improper
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_has_inconsistent_domains’:
pylinkgrammar/link_grammar_wrap.c:5801:17: warning: implicit declaration of function ‘linkage_has_inconsistent_domains’; did you mean ‘_wrap_linkage_has_inconsistent_domains’? [-Wimplicit-function-declaration]
5801 | result = (int)linkage_has_inconsistent_domains(arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_linkage_has_inconsistent_domains
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_post_process_open’:
pylinkgrammar/link_grammar_wrap.c:5839:3: error: unknown type name ‘PostProcessor’
5839 | PostProcessor *result = 0 ;
| ^~~~~~~~~~~~~
pylinkgrammar/link_grammar_wrap.c:5848:13: error: ‘PostProcessor’ undeclared (first use in this function)
5848 | result = (PostProcessor *)post_process_open(arg1);
| ^~~~~~~~~~~~~
pylinkgrammar/link_grammar_wrap.c:5848:13: note: each undeclared identifier is reported only once for each function it appears in
pylinkgrammar/link_grammar_wrap.c:5848:28: error: expected expression before ‘)’ token
5848 | result = (PostProcessor *)post_process_open(arg1);
| ^
pylinkgrammar/link_grammar_wrap.c:5834:9: warning: variable ‘arg1’ set but not used [-Wunused-but-set-variable]
5834 | char *arg1 = (char *) 0 ;
| ^~~~
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_post_process_close’:
pylinkgrammar/link_grammar_wrap.c:5860:3: error: unknown type name ‘PostProcessor’
5860 | PostProcessor *arg1 = (PostProcessor *) 0 ;
| ^~~~~~~~~~~~~
pylinkgrammar/link_grammar_wrap.c:5860:26: error: ‘PostProcessor’ undeclared (first use in this function)
5860 | PostProcessor *arg1 = (PostProcessor *) 0 ;
| ^~~~~~~~~~~~~
pylinkgrammar/link_grammar_wrap.c:5860:41: error: expected expression before ‘)’ token
5860 | PostProcessor *arg1 = (PostProcessor *) 0 ;
| ^
pylinkgrammar/link_grammar_wrap.c:5871:26: error: expected expression before ‘)’ token
5871 | arg1 = (PostProcessor *)(argp1);
| ^
pylinkgrammar/link_grammar_wrap.c:5872:3: warning: implicit declaration of function ‘post_process_close’; did you mean ‘_wrap_post_process_close’? [-Wimplicit-function-declaration]
5872 | post_process_close(arg1);
| ^~~~~~~~~~~~~~~~~~
| _wrap_post_process_close
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_post_process’:
pylinkgrammar/link_grammar_wrap.c:5883:3: error: unknown type name ‘PostProcessor’
5883 | PostProcessor *arg2 = (PostProcessor *) 0 ;
| ^~~~~~~~~~~~~
pylinkgrammar/link_grammar_wrap.c:5883:26: error: ‘PostProcessor’ undeclared (first use in this function)
5883 | PostProcessor *arg2 = (PostProcessor *) 0 ;
| ^~~~~~~~~~~~~
pylinkgrammar/link_grammar_wrap.c:5883:41: error: expected expression before ‘)’ token
5883 | PostProcessor *arg2 = (PostProcessor *) 0 ;
| ^
pylinkgrammar/link_grammar_wrap.c:5900:26: error: expected expression before ‘)’ token
5900 | arg2 = (PostProcessor *)(argp2);
| ^
pylinkgrammar/link_grammar_wrap.c:5901:3: warning: implicit declaration of function ‘linkage_post_process’; did you mean ‘_wrap_linkage_post_process’? [-Wimplicit-function-declaration]
5901 | linkage_post_process(arg1,arg2);
| ^~~~~~~~~~~~~~~~~~~~
| _wrap_linkage_post_process
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_constituent_tree’:
pylinkgrammar/link_grammar_wrap.c:5915:3: error: unknown type name ‘CNode’
5915 | CNode *result = 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:5924:13: error: ‘CNode’ undeclared (first use in this function)
5924 | result = (CNode *)linkage_constituent_tree(arg1);
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:5924:20: error: expected expression before ‘)’ token
5924 | result = (CNode *)linkage_constituent_tree(arg1);
| ^
pylinkgrammar/link_grammar_wrap.c:5911:11: warning: variable ‘arg1’ set but not used [-Wunused-but-set-variable]
5911 | Linkage arg1 = (Linkage) 0 ;
| ^~~~
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_free_constituent_tree’:
pylinkgrammar/link_grammar_wrap.c:5934:3: error: unknown type name ‘CNode’
5934 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:5934:18: error: ‘CNode’ undeclared (first use in this function)
5934 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:5934:25: error: expected expression before ‘)’ token
5934 | CNode *arg1 = (CNode *) 0 ;
| ^
pylinkgrammar/link_grammar_wrap.c:5945:18: error: expected expression before ‘)’ token
5945 | arg1 = (CNode *)(argp1);
| ^
pylinkgrammar/link_grammar_wrap.c:5946:3: warning: implicit declaration of function ‘linkage_free_constituent_tree’; did you mean ‘linkage_free_constituent_tree_str’? [-Wimplicit-function-declaration]
5946 | linkage_free_constituent_tree(arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| linkage_free_constituent_tree_str
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_constituent_node_get_label’:
pylinkgrammar/link_grammar_wrap.c:5956:3: error: unknown type name ‘CNode’
5956 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:5956:18: error: ‘CNode’ undeclared (first use in this function)
5956 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:5956:25: error: expected expression before ‘)’ token
5956 | CNode *arg1 = (CNode *) 0 ;
| ^
pylinkgrammar/link_grammar_wrap.c:5968:18: error: expected expression before ‘)’ token
5968 | arg1 = (CNode *)(argp1);
| ^
pylinkgrammar/link_grammar_wrap.c:5969:20: warning: implicit declaration of function ‘linkage_constituent_node_get_label’; did you mean ‘_wrap_linkage_constituent_node_get_label’? [-Wimplicit-function-declaration]
5969 | result = (char *)linkage_constituent_node_get_label((struct CNode_s const *)arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_linkage_constituent_node_get_label
pylinkgrammar/link_grammar_wrap.c:5969:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
5969 | result = (char *)linkage_constituent_node_get_label((struct CNode_s const *)arg1);
| ^
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_constituent_node_get_child’:
pylinkgrammar/link_grammar_wrap.c:5979:3: error: unknown type name ‘CNode’
5979 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:5979:18: error: ‘CNode’ undeclared (first use in this function)
5979 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:5979:25: error: expected expression before ‘)’ token
5979 | CNode *arg1 = (CNode *) 0 ;
| ^
pylinkgrammar/link_grammar_wrap.c:5983:10: error: ‘result’ undeclared (first use in this function)
5983 | CNode *result = 0 ;
| ^~~~~~
pylinkgrammar/link_grammar_wrap.c:5991:18: error: expected expression before ‘)’ token
5991 | arg1 = (CNode *)(argp1);
| ^
pylinkgrammar/link_grammar_wrap.c:5992:20: error: expected expression before ‘)’ token
5992 | result = (CNode *)linkage_constituent_node_get_child((struct CNode_s const *)arg1);
| ^
pylinkgrammar/link_grammar_wrap.c:5979:10: warning: variable ‘arg1’ set but not used [-Wunused-but-set-variable]
5979 | CNode *arg1 = (CNode *) 0 ;
| ^~~~
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_constituent_node_get_next’:
pylinkgrammar/link_grammar_wrap.c:6002:3: error: unknown type name ‘CNode’
6002 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:6002:18: error: ‘CNode’ undeclared (first use in this function)
6002 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:6002:25: error: expected expression before ‘)’ token
6002 | CNode *arg1 = (CNode *) 0 ;
| ^
pylinkgrammar/link_grammar_wrap.c:6006:10: error: ‘result’ undeclared (first use in this function)
6006 | CNode *result = 0 ;
| ^~~~~~
pylinkgrammar/link_grammar_wrap.c:6014:18: error: expected expression before ‘)’ token
6014 | arg1 = (CNode *)(argp1);
| ^
pylinkgrammar/link_grammar_wrap.c:6015:20: error: expected expression before ‘)’ token
6015 | result = (CNode *)linkage_constituent_node_get_next((struct CNode_s const *)arg1);
| ^
pylinkgrammar/link_grammar_wrap.c:6002:10: warning: variable ‘arg1’ set but not used [-Wunused-but-set-variable]
6002 | CNode *arg1 = (CNode *) 0 ;
| ^~~~
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_constituent_node_get_start’:
pylinkgrammar/link_grammar_wrap.c:6025:3: error: unknown type name ‘CNode’
6025 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:6025:18: error: ‘CNode’ undeclared (first use in this function)
6025 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:6025:25: error: expected expression before ‘)’ token
6025 | CNode *arg1 = (CNode *) 0 ;
| ^
pylinkgrammar/link_grammar_wrap.c:6037:18: error: expected expression before ‘)’ token
6037 | arg1 = (CNode *)(argp1);
| ^
pylinkgrammar/link_grammar_wrap.c:6038:17: warning: implicit declaration of function ‘linkage_constituent_node_get_start’; did you mean ‘_wrap_linkage_constituent_node_get_start’? [-Wimplicit-function-declaration]
6038 | result = (int)linkage_constituent_node_get_start((struct CNode_s const *)arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_linkage_constituent_node_get_start
pylinkgrammar/link_grammar_wrap.c: In function ‘_wrap_linkage_constituent_node_get_end’:
pylinkgrammar/link_grammar_wrap.c:6048:3: error: unknown type name ‘CNode’
6048 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:6048:18: error: ‘CNode’ undeclared (first use in this function)
6048 | CNode *arg1 = (CNode *) 0 ;
| ^~~~~
pylinkgrammar/link_grammar_wrap.c:6048:25: error: expected expression before ‘)’ token
6048 | CNode *arg1 = (CNode *) 0 ;
| ^
pylinkgrammar/link_grammar_wrap.c:6060:18: error: expected expression before ‘)’ token
6060 | arg1 = (CNode *)(argp1);
| ^
pylinkgrammar/link_grammar_wrap.c:6061:17: warning: implicit declaration of function ‘linkage_constituent_node_get_end’; did you mean ‘_wrap_linkage_constituent_node_get_end’? [-Wimplicit-function-declaration]
6061 | result = (int)linkage_constituent_node_get_end((struct CNode_s const *)arg1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| _wrap_linkage_constituent_node_get_end
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pylinkgrammar
Running setup.py clean for pylinkgrammar
Failed to build pylinkgrammar
ERROR: Could not build wheels for pylinkgrammar, which is required to install pyproject.toml-based projects