Lingua-XFST

 view release on metacpan or  search on metacpan

privates/xfsm_api.h  view on Meta::CPAN

     be used to produce a complement of a simple relation. For
     example, minus_net(read_regex("?:?"), read_regex("a:b"),
     DONT_KEEP) that maps any symbol to itself and to any other symbol
     except that the pair a:b is missing. The correspoding regular
     expression operator is -. */

  NETptr compose_net(NETptr upper, NETptr lower, int keep_upper_p,
                     int keep_lower_p);
  /* Returns the composition of the two networks. The corresponding
     regular expression operator is .o. */

  NETptr crossproduct_net(NETptr upper, NETptr lower, int keep_upper_p,
                          int keep_lower_p);
  /* Returns a network that pairs all the strings in the languages of
     the two networks with each other. If keep_p is DONT_KEEP the
     network is reclaimed. The corresponding regular expression
     operators are .x. (low binding preference) and : (high binding
     preference. */

  NETptr ignore_net(NETptr target, NETptr noise, int keep_target_p,
                    int keep_noise_p);
  /* Returns a network that is like the target except that every state
     of the network contains a loop that contains all the paths of the
     noise network. For example, ignore_net(read_regex("a b c"),
     symbol_net("x"), DONT_KEEP, DONT_KEEP); returns a language that
     contains the string "abc" and an infinite number of strings such
     as "axbcxb" that contain bursts of noise. The correspoding
     regular expression operator is /. */

  NETptr priority_union_net(NETptr net1, NETptr net2, int side,
                            int keep_net1_p, int keep_net2_p);
  /* Returns a network that represents the union of net1 and net2 that
     gives net1 preference over net2 on the given side (UPPER or
     LOWER).  For example, if the side is UPPER and net1 consists of
     the pair a:b and net2 consists of the pairs a:c and d:e, the
     priority union of the two consists of the pairs a:b and d:e. The
     a:c pair from net2 is discarded because net1 has another pair
     with a on the upper side. The d:e pair from net2 is included
     because net1 has no competing mapping for the upper side d. The
     corresponding regular expression operators are .p. for priority
     union on the LOWER side and .P. for UPPER priority union. */

  NETptr lenient_compose_net(NETptr upper, NETptr lower, int keep_upper_p,
                             int keep_lower_p);
  /* A function for experimenting with optimality theory (OT).
     The lenient composition of upper and lower is defined as follows:
     upper .O. lower = [[upper .o. lower] .P. upper]
     where .0. is the lenient compose operator,. .o. is ordinary
     composition and .P. is priority union.
     To make sense of this, think of upper as a transducer that maps
     each of the strings of the input language into all of its
     possible realization. In other words, upper is the composition
     of the input language with GEN. The lower network represents
     a constraint language that rules out some, maybe all of the
     outputs. The result of the lenient composition is a network that
     maps each input string to the outputs that meet the constraint
     if there are any, eliminating the outputs that violate the
     constraint. However, if none of the outputs of a given input
     meet the constraint, all of them remain. That is, lenient
     composition guarantees that every input has outputs. A set
     of ranked OT constraints can be implemented as a cascade of
     lenient compositions with the most higly ranked constraint on
     the top of the cascade. */

  NETptr close_sigma(NETptr net, ALPHABETptr new_symbols,
  		     int copy_p, int minimize_p);
  /* Error handling */

  void set_error_function(void (*fn)(const char *message,
				     const char *function_name,
                                     int code));

  void set_warning_function(void (*fn)(const char *message,
				       const char *function_name,
                                       int code));

#ifdef __cplusplus
}
#endif /* __ cplusplus */

#endif /* XFSM_API */



( run in 0.867 second using v1.01-cache-2.11-cpan-9581c071862 )