Delphin mkprof

I think I’ve asked this before but I cannot locate the answer anymore.

Is there a way to use delphin’s mkprof option via the API (in a python program), or is it only a command line option?

Yes, all the subcommands of the delphin command are available as API functions in delphin.commands (see the API docs and the guide; I’ve reviewed the docs recently but please file an issue if you find something inaccurate or outdated).

>>> from delphin import commands
>>> commands.mkprof(
...     'my-copy',
...     source='~/grammars/erg-trunk/tsdb/gold/csli',
...     where='i-length < 12',
...     full=True,
...     gzip=True)
    9746 bytes	relations
   13974 bytes	item.gz
       0 bytes	analysis
     444 bytes	phenomenon.gz
       0 bytes	parameter
       0 bytes	set
    5789 bytes	item-phenomenon.gz
       0 bytes	item-set
    1410 bytes	run.gz
  175311 bytes	parse.gz
  224668 bytes	result.gz
       0 bytes	rule
       0 bytes	output
       0 bytes	edge
    8447 bytes	tree.gz
   55022 bytes	decision.gz
    2008 bytes	preference.gz
    4637 bytes	update.gz
       0 bytes	fold
       0 bytes	score
1 Like