Alvis-NLPPlatform

 view release on metacpan or  search on metacpan

lib/Alvis/NLPPlatform/patches/link-4.1a-WithWhiteSpace.diff  view on Meta::CPAN

  int          sentence_length(Sentence sent);
diff -cr ./include/api-structures.h ../link-4.1a-WithWhiteSpace/include/api-structures.h
*** ./include/api-structures.h	2004-02-01 21:57:41.000000000 +0100
--- ../link-4.1a-WithWhiteSpace/include/api-structures.h	2006-11-02 11:32:07.000000000 +0100
***************
*** 83,88 ****
--- 83,89 ----
    int display_constituents;     /* if true, output treebank-style constituent structure */
    int display_bad;              /* if true, bad linkages are displayed */
    int display_links;            /* if true, a list o' links is printed out */
+   int whitespace; 		/* if true, a whitespace tokenization only is considered */
  };
  
  typedef struct {
diff -cr ./include/tokenize.h ../link-4.1a-WithWhiteSpace/include/tokenize.h
*** ./include/tokenize.h	2004-02-01 21:57:42.000000000 +0100
--- ../link-4.1a-WithWhiteSpace/include/tokenize.h	2006-11-02 11:32:07.000000000 +0100
***************
*** 10,15 ****
  /* with or without modification, subject to certain conditions.                 */
  /*                                                                              */
  /********************************************************************************/
! int separate_sentence(char * s, Sentence sent);
  int build_sentence_expressions(Sentence sent);
  int sentence_in_dictionary(Sentence sent);
--- 10,15 ----
  /* with or without modification, subject to certain conditions.                 */
  /*                                                                              */
  /********************************************************************************/
! int separate_sentence(char * s, Sentence sent, Parse_Options opts);
  int build_sentence_expressions(Sentence sent);
  int sentence_in_dictionary(Sentence sent);
Files ./parse and ../link-4.1a-WithWhiteSpace/parse differ
diff -cr ./src/api.c ../link-4.1a-WithWhiteSpace/src/api.c
*** ./src/api.c	2004-02-01 21:57:54.000000000 +0100
--- ../link-4.1a-WithWhiteSpace/src/api.c	2006-11-02 11:32:06.000000000 +0100
***************
*** 78,83 ****
--- 78,84 ----
      po->display_constituents = 0;
      po->display_bad = FALSE;
      po->display_links = FALSE;
+     po->whitespace = FALSE;
  
      return po;
  }
***************
*** 295,300 ****
--- 296,309 ----
      opts->display_union = dummy;
  }
  
+ int parse_options_get_whitespace(Parse_Options opts) {
+     return opts->whitespace;
+ }
+ 
+ void parse_options_set_whitespace(Parse_Options opts, int dummy) {
+     opts->whitespace = dummy;
+ }
+ 
  int parse_options_timer_expired(Parse_Options opts) {
      return resources_timer_expired(opts->resources);
  }
***************
*** 466,472 ****
  *
  ****************************************************************/
  
! Sentence sentence_create(char *input_string, Dictionary dict) {
      Sentence sent;
      int i;
  
--- 475,481 ----
  *
  ****************************************************************/
  
! Sentence sentence_create(char *input_string, Dictionary dict, Parse_Options opts) {
      Sentence sent;
      int i;
  
***************
*** 487,493 ****
      sent->parse_info = NULL;
      sent->string_set = string_set_create();
  
!     if (!separate_sentence(input_string, sent)) {
  	string_set_delete(sent->string_set);
  	xfree(sent, sizeof(struct Sentence_s));
  	return NULL;
--- 496,502 ----
      sent->parse_info = NULL;
      sent->string_set = string_set_create();
  
!     if (!separate_sentence(input_string, sent, opts)) {
  	string_set_delete(sent->string_set);
  	xfree(sent, sizeof(struct Sentence_s));
  	return NULL;
diff -cr ./src/command-line.c ../link-4.1a-WithWhiteSpace/src/command-line.c
*** ./src/command-line.c	2004-02-01 21:57:54.000000000 +0100
--- ../link-4.1a-WithWhiteSpace/src/command-line.c	2006-11-02 11:32:06.000000000 +0100
***************
*** 21,26 ****
--- 21,27 ----
      int null_block;
      int islands_ok;
      int short_length;
+     int whitespace;
      int batch_mode;  
      int panic_mode;  
      int allow_null;
***************
*** 64,69 ****
--- 65,71 ----
      {"links",        1, "Showing of complete link data",    &local.display_links},
      {"walls",        1, "Showing of wall words",            &local.display_walls},
      {"union",        1, "Showing of 'union' linkage",       &local.display_union},
+     {"whitespace",   1, "White space tokenization",         &local.whitespace},
      {NULL,           1,  NULL,                              NULL}
  };
  
***************
*** 229,234 ****



( run in 1.329 second using v1.01-cache-2.11-cpan-acf6aa7dc9e )