Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PackageHfstSfstRules

eaxelson edited this pageSep 5, 2017 ·6 revisions

Package hfst.sfst_rules

SFST-type rules.

two_level_if(context, mappings, alphabet)

A transducer that obligatorily performs the mappings defined bymappings in the contextcontext when the alphabet isalphabet.

  • context A pair of transducers where the first transducer defines the left context and the second transducer the right context.
  • mappings A set of mappings (a tuple of string pairs) that the resulting transducer will perform in the context given incontext.
  • alphabet The set of symbol pairs (a tuple of string pairs) that defines the alphabet (see the example).

For example, a transducer yielded by the following arguments (in pseudcode)

context = pair( [c|d], [e] )mappings = set(a:b)alphabet = set(a, a:b, b, c, d, e, ...)

obligatorily maps the symbol a to b if c or d precedes and e follows. (Elsewhere,the mapping of a to b is optional). This expression is identical to![.* [c|d] [a:. & !a:b] [e] .*]Note that the alphabet must contain the pair a:b here.See also:SFST manual

two_level_only_if(context, mappings, alphabet)

A transducer that allows the mappings defined bymappings only in the contextcontext, when the alphabet isalphabet.

If called with the same arguments as in the example of #two_level_if, the transducerallows the mapping of symbol a to b only if c or d precedes and e follows.The mapping of a to b is optional in this context but cannot occur in any other context.

The expression is equivalent to![ [ ![.* [c|d]] a:b .* ] | [ .* a:b ![[e] .*] ] ]

See also: #two_level_if

two_level_if_and_only_if(context, mappings, alphabet)

A transducer that always performs the mappings defined bymappings in the contextcontext and only in that context, when the alphabet isalphabet.

If called with the same arguments as in the example of #two_level_if, the transducermaps symbol a to b only and only if c or d precedes and e follows.The mapping of a to b is obligatory in this context and cannot occur in any other context.

The expression is equivalent to

![.* [c|d] [a:. & !a:b] [e] .*]  &![  [ ![.* [c|d]] a:b .* ] | [ .* a:b ![[e] .*] ]  ]

See also: #two_level_if

replace_up(context, mapping, optional, alphabet)

A transducer that performs an upward mappingmapping in the contextcontext when the alphabet isalphabet.optional defines whether the mapping is optional.

  • context A pair of transducers where the first transducer defines the left context and the second transducer the right context. Both transducers must be automata, i.e. map strings onto themselves.
  • mapping The mapping (transducer) that the resulting transducer will perform in the context given incontext.
  • optional Whether the mapping is optional.
  • alphabet The set of symbol pairs that defines the alphabet (a tuple of string pairs).

Each substring s of the input string which is in the input language of the transducermapping and whose left context is matchedby the expression[.* l] (where l is the first element ofcontext) and whose right context is matched by[r .*](where r is the second element in the context) is mapped to the respective surface strings defined by transducermapping. Any othercharacter is mapped to the characters specified inalphabet. The left and right contexts mustbe automata (i.e. transducers which map strings onto themselves).

For example, a transducer yielded by the following arguments (in pseudocode)

context = pair( [c], [c] )mappings = [ a:b a:b ]alphabet = set(a, b, c)

would map the string "caacac" to "cbbcac".

Note that the alphabet must contain the characters a and b, but not the paira:b (unless this replacement is to be allowed everywhere in the context).

Note that replace operations (unlike the two-level rules) have to be combined by compositionrather than intersection.

Throws:

See also:SFST manual

replace_down(context, mapping, optional, alphabet)

The same as replace_up, but matching is done on the output side ofmappingSee also: replace_upSFST manual.

replace_down_karttunen(context, mapping, optional, alphabet)

TODO: document

replace_left(context, mapping, optional, alphabet)

The same as replace_up, but left context matching is done on the output side ofmapping and right context on the input side ofmapping.

See also: replace_up

replace_right(context, mapping, optional, alphabet)

The same as replace_up, but left context matching is done on the input side ofmapping and right context on the output side ofmapping.

See also: replace_upSFST manual.

replace_up(mapping, optional, alphabet)

The same as replace_up butmapping is performed in every context.

See also: replace_up

replace_down(mapping, optional, alphabet)

The same as replace_down(context, mapping, optional, alphabet)) butmapping is performed in every context.

See also: replace_up

left_replace_up(mapping, optional, alphabet)

Inversion of the replace_up and the result needs to be composed on the upper side of the input language.

B <- A is the inversion of A -> B.mapping is performed in every context.See also: replace_up

left_replace_up(context, mapping, optional, alphabet)

Inversion of the replace_up and the result needs to be composed on the upper side of the input language.

B <- A is the inversion of A -> B.See also: replace_up

left_replace_down(context, mapping, optional, alphabet)

Inversion of the replace_up and the result needs to be composed on the upper side of the input language. However, matching is done on the output side ofmapping.

See also: replace_up

left_replace_down_karttunen(context, mapping, optional, alphabet)

Inversion of the replace_up and the result needs to be composed on the upper side of the input language. However, matching is done on the output side ofmapping.

See also: replace_up

left_replace_left(context, mapping, optional, alphabet)

Inversion of the replace_up and the result needs to be composed on the upper side of the input language. However, left context matching is done on the input side ofmapping and right context on the output side ofmapping.

See also: replace_up */

left_replace_right(context, mapping, optional, alphabet)

Inversion of the replace_up and the result needs to be composed on the upper side of the input language. However, left context matching is done on the output side ofmapping and right context on the input side ofmapping.

See also: replace_up

restriction(contexts, mapping, alphabet)

A transducer that allows any (substring) mapping defined bymapping only if it occurs in any of the contexts incontexts. Symbols outside of the matching substrings are mapped to any symbol allowed byalphabet.

Throws:

See also:SFST manual.

  • contexts A tuple of HfstTransducer pairs.
  • mapping An HfstTransducer.
  • alphabet A tuple of string pairs.

coercion(contexts, mapping, alphabet)

A transducer that requires that one of the mappings defined bymapping must occur in each context incontexts. Symbols outside of the matching substrings are mapped to any symbol allowed byalphabet.

See also:SFST manual.

  • contexts A tuple of HfstTransducer pairs.
  • mapping An HfstTransducer.
  • alphabet A tuple of string pairs.

restriction_and_coercion(contexts, mapping, alphabet)

A transducer that is equivalent to the intersection of restriction and coercion and requires that the mappings defined bymapping occur always and only in the given contexts incontexts. Symbols outside of the matching substrings are mapped to any symbol allowed byalphabet.

See also: #restriction #coercionSFST manual

  • contexts A tuple of HfstTransducer pairs.
  • mapping An HfstTransducer.
  • alphabet A tuple of string pairs.

surface_restriction(contexts, mapping, alphabet)

A transducer that specifies that a string from the input language of the transducermapping may only be mapped to one of its output strings (according to transducermapping) if it appears in any of the contexts incontexts. Symbols outside of the matching substrings are mapped to any symbol allowed byalphabet.

See also:SFST manual.

  • contexts A tuple of HfstTransducer pairs.
  • mapping An HfstTransducer.
  • alphabet A tuple of string pairs.

surface_coercion(contexts, mapping, alphabet)

A transducer that specifies that a string from the input language of the transducermapping always has to the mapped to one of its output strings according to transducermapping if it appears in any of the contexts incontexts. Symbols outside of the matching substrings are mapped to any symbol allowed byalphabet.

See also:SFST manual.

  • contexts A tuple of HfstTransducer pairs.
  • mapping An HfstTransducer.
  • alphabet A tuple of string pairs.

surface_restriction_and_coercion(contexts, mapping, alphabet)

A transducer that is equivalent to the intersection of surface_restriction and surface_coercion.

See also: #surface_restriction #surface_coercionSFST manual.

  • contexts A tuple of HfstTransducer pairs.
  • mapping An HfstTransducer.
  • alphabet A tuple of string pairs.

deep_restriction(contexts, mapping, alphabet)

A transducer that specifies that a string from the output language of the transducermapping may only be mapped to one of its input strings (according to transducermappings) if it appears in any of the contexts incontexts.Symbols outside of the matching substrings are mapped to any symbol allowed byalphabet.

See also:SFST manual.

  • contexts A tuple of HfstTransducer pairs.
  • mapping An HfstTransducer.
  • alphabet A tuple of string pairs.

deep_coercion(contexts, mapping, alphabet)

A transducer that specifies that a string from the output language of the transducermapping always has to be mapped to one of its input strings (according to transducermappings) if it appears in any of the contexts incontexts. Symbols outside of the matching substrings are mapped to any symbol allowed byalphabet.

See also:SFST manual.

  • contexts A tuple of HfstTransducer pairs.
  • mapping An HfstTransducer.
  • alphabet A tuple of string pairs.

deep_restriction_and_coercion(contexts, mapping, alphabet)

A transducer that is equivalent to the intersection of deep_restriction and deep_coercion.

See also: #deep_restriction #deep_coercionSFST manual.

  • contexts A tuple of HfstTransducer pairs.
  • mapping An HfstTransducer.
  • alphabet A tuple of string pairs.
Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp