Difference between revisions of "Sort a dictionary"

From Apertium
Jump to navigation Jump to search
Line 3: Line 3:
A task for sorting dictionaries is available in the [[apertium-dixtools]] package.
A task for sorting dictionaries is available in the [[apertium-dixtools]] package.


<pre>
<!--
Usage: apertium-dixtools sort [-group <symbol list>] [-right] [-ignorecase] <dic.dix> <out.dix>
=== "Same file" mode ===

-->
-ignorecase ignore case when sorting
$ apertium-dixtools sort -mon dics/morf.dix morf-xincluded.dix

-right will sort according to value on right side (useful bidixes)

-group <commaseparated list> will group symbol categories together. For example:
-group n,n_symbol,adj,adv,vblex,vblex_symbol
will sort all nouns, adj, adv and verbs together. Other entries will be sorted separately
</pre>

There are also a number of [[apertium-dixtools#generic options|generic options]]

===Examples===

Simple sorting, piping to less

$ apertium-dixtools sort -alignBidix apertium-sv-da.sv-da.dix - | less


Sorting, grouping nouns together, overwriting the original file

$ apertium-dixtools sort -group n,n_symbol -alignBidix apertium-eo-en.en.dix apertium-eo-en.en.dix



<!--
<!--

Revision as of 17:13, 3 November 2009

Sort task

A task for sorting dictionaries is available in the apertium-dixtools package.

Usage: apertium-dixtools sort [-group <symbol list>] [-right] [-ignorecase] <dic.dix> <out.dix>

  -ignorecase ignore case when sorting

  -right  will sort according to value on right side (useful bidixes)

  -group <commaseparated list>  will group symbol categories together. For example:
     -group n,n_symbol,adj,adv,vblex,vblex_symbol 
      will sort all nouns, adj, adv and verbs together. Other entries will be sorted separately

There are also a number of generic options

Examples

Simple sorting, piping to less

$ apertium-dixtools sort -alignBidix apertium-sv-da.sv-da.dix - | less


Sorting, grouping nouns together, overwriting the original file

$ apertium-dixtools sort -group n,n_symbol -alignBidix apertium-eo-en.en.dix apertium-eo-en.en.dix


See also