Difference between revisions of "Compounds"

From Apertium
Jump to navigation Jump to search
Line 19: Line 19:


# Read word from left to right.
# Read word from left to right.
# Take the longest match first from the dictionaries, e.g. infrastruktuurontwikkelingsplan,
# Take the shortest match first from the dictionaries, e.g. infrastruktuurontwikkelingsplan,
## Read i-n-f-r-a-s-t-r-u-k-u-u-r (add, because no words have +o)
## Read i-n-f-r-a-s-t-r-u-k-u-u-r (add, because no words have +o)
## Read o-n-t-w-i-k-k-e-l-i-n-g-s (add, because no words have +p)
## Read o-n-t-w-i-k-k-e-l-i-n-g-s (add, because no words have +p)
## Read p-l-a-n
## Read p-l-a-n
# Output in order.
# Output in order.

output: ^infrastruktuur<n><sg>$ ^ontwikkeling<n><pl>$ ^plan<n><sg>$

===Left-to-right longest-match===

input: ^*infrastruktuurontwikkelingsplan$

# Read word from left to right.
# Take the longest match first from the dictionaries, e.g. infrastruktuurontwikkelingsplan,
# While not found:
# Read infrastruktuurontwikkelingsplan
# Read infrastruktuurontwikkelingspla
# Read infrastruktuurontwikkelingspl
# ...
# When a word is found, e.g. "infrastruktuur", remove it from the string, put it in the output queue, and start the process again with ontwikkelingsplan.
# Output each item from the output queue in order.


output: ^infrastruktuur<n><sg>$ ^ontwikkeling<n><pl>$ ^plan<n><sg>$
output: ^infrastruktuur<n><sg>$ ^ontwikkeling<n><pl>$ ^plan<n><sg>$

Revision as of 13:28, 20 September 2007

Some languages (in Indo-European particularly Germanic languages) like to make long compound words with low frequency that are unlikely to be found in dictionaries. Typically for any "normal" noun, there can be around 10—100 compound nouns which inflect in exactly the same way (at least for Afrikaans).

  • Afrikaans: infrastruktuurontwikkelingsplan, infrastruktuur+ontwikkelings+plan ("infrastructure development plan"), (cf. personeelverminderingsprosedure, "personnel protection procedure")
  • Dutch : "hulpagina" (help page), "woordbetekenis" (meaning of a word), "inwonertal" (number of inhabitants)
  • German: Kontaktlinsenverträglichkeitstest, Kontakt+linsen+verträglichkeits+test ("contact-lens compatibility test")

Perhaps there could be some method of attempting to resolve unknown compound words into their constituent parts.

Outstanding questions

  • Where would compound processing go in the pipeline? Presumably after initial analysis? e.g. in between lt-proc and apertium-tagger.

Proposed algorithms

Baseline

input: ^*infrastruktuurontwikkelingsplan$

  1. Read word from left to right.
  2. Take the shortest match first from the dictionaries, e.g. infrastruktuurontwikkelingsplan,
    1. Read i-n-f-r-a-s-t-r-u-k-u-u-r (add, because no words have +o)
    2. Read o-n-t-w-i-k-k-e-l-i-n-g-s (add, because no words have +p)
    3. Read p-l-a-n
  3. Output in order.

output: ^infrastruktuur<n><sg>$ ^ontwikkeling<n><pl>$ ^plan<n><sg>$

Left-to-right longest-match

input: ^*infrastruktuurontwikkelingsplan$

  1. Read word from left to right.
  2. Take the longest match first from the dictionaries, e.g. infrastruktuurontwikkelingsplan,
  3. While not found:
  4. Read infrastruktuurontwikkelingsplan
  5. Read infrastruktuurontwikkelingspla
  6. Read infrastruktuurontwikkelingspl
  7. ...
  8. When a word is found, e.g. "infrastruktuur", remove it from the string, put it in the output queue, and start the process again with ontwikkelingsplan.
  9. Output each item from the output queue in order.

output: ^infrastruktuur<n><sg>$ ^ontwikkeling<n><pl>$ ^plan<n><sg>$

Further reading