[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lojban] Re: Help parsing Lojban from Python? (Hey, Riley! :)
- To: Riley Martinez-Lynch <shunpiker@gmail.com>
- Subject: [lojban] Re: Help parsing Lojban from Python? (Hey, Riley! :)
- From: Robin Lee Powell <robinleepowell@gmail.com>
- Date: Fri, 27 Aug 2021 21:02:24 -0700
- Arc-authentication-results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ObughYE5; spf=pass (google.com: domain of robinleepowell@gmail.com designates 2607:f8b0:4864:20::529 as permitted sender) smtp.mailfrom=robinleepowell@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
- Arc-authentication-results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ObughYE5; spf=pass (google.com: domain of robinleepowell@gmail.com designates 2607:f8b0:4864:20::529 as permitted sender) smtp.mailfrom=robinleepowell@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature :dkim-signature; bh=8UoEUOAROkybiNKkTO14G4CF1Soa2TDA/Jz460baP9k=; b=FI8kTOZwZ9tmvmAHScNy3M4MqfQMFFlxEmdAmC1fmzRiwkKJLDbwhmGOwIS63OVJRz pTGJqZ5xwZ52PmptLSSF6FqVn4buQl/mV3QSVSHDlLON49Q+8f4UqbltXiCeuIVg7pgL OtxyWGDJsoN+Ux+yBN5rRHa9CCckLmukI9/30+Q9Df8JRubS590Aud/xFbmeXc6fcJsK MoatHt0sktQvt7fEyOuu8JJiDYrUeQ8S9FjhbACWKHgu9tOIQQYrQRt8BzoxIYwwTrfP rN7Lt6+zHZ1beKoYNWzYKBXX91w4iY5Jvdp/CYrYZoxjjnChi+j2h+NbUPQiIwJ7T363 /AmQ==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=cmWgMdCgAsKdK563dC5OqQ41MRysY+ak1wZGnD8sydU=; b=ydVyrY/dWs04SxPBkb8Bi9ZBmeCh61xMLCUFXsVPL852zYJ/8LF0JVOiIr1nyl+ykl SatgV4RhI44vhiZ1iT/Nj69x6onrRePvmS1P32udYgy8FM8GnF14keLLjbYozmOOm6Xb 9Db0dVzJbnVM9sGMML7B8g6YBh4ZkwvAgj5T9JJvXDNIegmISx0k2/hcq/a7n316LAry 0K2M6dsoe+GWMqBQHOCEx3Ettk8QDqkBN0w9YqIpbHljJ2xWXb2Q1r6dAKHvd2ULHN72 b45U/wzNcopYFxJ+Q1ScRlfFiOw2OaIYvsd2zhZRxduK897tfrY0CsVc8pfOTFw8E82a GZYg==
- Arc-seal: i=2; a=rsa-sha256; t=1630123348; cv=pass; d=google.com; s=arc-20160816; b=Ph7lZzj89eUzI/PdYGVmACgi6A4/ZkcjCehadM93CDEGGNPh9R2gKw6NF/tQwzmu0o aNgicyIGJEnD20jnj4VIRBulGGOysFGHwreQ8Zh/HSuvqqK7S0WfaBiRYLT+Spp56u0E kOVLdEaYrhSMnr/KVic0tVHAYyNcD+eI5LLPKXHG2HmMAeaxCtW9wOEzPb+q/lCBS7wq IwD/vB/IcmvQ5xwR9L0Qh2YK38aHzZVO9OLcUee72O8DQB0Afo7r9pddSCM/0sNMOEh3 AnekxXKw6pk+gqKG72D+JnuBsTQIOvOGI8kQ5uU4GOSVAz5BFk4wl/wp2FVU/nnn1Ey6 EYfg==
- Arc-seal: i=1; a=rsa-sha256; t=1630123347; cv=none; d=google.com; s=arc-20160816; b=zDRsxGyyHP1EzoWIR0VSqIMmMtdGAjTX6bC4tz6HrsXB67xDlmF8DCImjW0ChYRnM7 JmqehZACIKZqXELbjZRsR7A4KjjjvQ6C1i7OK5m/3ZrMV0YRT4vZNn5s9ckyWsHEo4is cQHPeI0v4JmJ4VBdDUt3C4FCy9BcYkikYtMK3FXNs4vHKLLiYlPlmLm7dQ1ykAN5Mrqp ji0gg0w9Y+WUK2sCWFwmheUmb+LBDUOTDZPWz2NfHDkZOjHcuncprgJGP9KUk/Zl4l+7 IRjJUwFgCt3NjcQOgYvtAD+3A7C148BOb3v+lz4GpYmsJnpJLcJX0yueoKFhAXKdxMdj mhSQ==
- Cc: lojban@googlegroups.com
- Delivery-date: Fri, 27 Aug 2021 21:02:33 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=8UoEUOAROkybiNKkTO14G4CF1Soa2TDA/Jz460baP9k=; b=q4cc2zN7y3esLhkqJeEetstmW40tID1D/xt4yUB1PixLfZPDOHYDbpiYhnb5++QaGe 3CJr+YgeM4OHoPcUkos0cx4snWY4gM6Vz7tECZTyvenYbfLIHBxD55jkcfLM98iStiHo 0qoft/x8jb4zGxTqCa6lmz22yDTd4IgFoxbO/fmIQeKf5VKHRbusuDq4dKa3W5Fr04Ki fJtiUnavoJerl3sN5Lpon2ZbuLZ77zZ9z6Qru3hcCQ12TKNmQaCQT0t1MyMrRS/GHBPd A5VbKqKUoswsLNgW9Y5H1Tb+9sg+I5kNW18PFf7tgaU+996VI73RW95ZGNz8kbdpVDsy Bk1g==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=8UoEUOAROkybiNKkTO14G4CF1Soa2TDA/Jz460baP9k=; b=CGgCbaNMmKjDDlv82GE+pRwjyb2BcTUAAs8HIw+pkil4Rkw3S+nypXOf4mp9+v4d2l X90Zzv/Dgse51EPdUJZS6MSJzHe+XZDVToGK7h22y/Y7gLRukpnjbCxWym5aY3COL+rW u0DBWIVjCyLnDY5atSf18uLr8X679SbPDUwkWadkj57PxTuyquNFfRfZnbr2EdhDlOJf iMBdqmdHyV7+azVsmeIHobcxKVCn9h8kuHO9tr3xQBl/ch2Nr1ns03i6IzI0mUPnvXlc kmGdlxdNi3jh6kfO1zI1jpiiaBl9DdodwlGDsG/DP0J4jK5Sv09FC9f+DEWCt6MDmbWH njjQ==
- Envelope-to: lojban-list-archive@lojban.org
- In-reply-to: <B6AB9786-1025-4F5E-A196-C83556B8EDC6@gmail.com>
- List-archive: <https://groups.google.com/group/lojba>
- List-help: <https://groups.google.com/support/>, <mailto:lojban+help@googlegroups.com>
- List-id: <lojban.googlegroups.com>
- List-post: <https://groups.google.com/group/lojban/post>, <mailto:lojban@googlegroups.com>
- List-subscribe: <https://groups.google.com/group/lojban/subscribe>, <mailto:lojban+subscribe@googlegroups.com>
- List-unsubscribe: <mailto:googlegroups-manage+1004133512417+unsubscribe@googlegroups.com>, <https://groups.google.com/group/lojban/subscribe>
- Mailing-list: list lojban@googlegroups.com; contact lojban+owners@googlegroups.com
- References: <20210827021139.GO309000@gmail.com> <B6AB9786-1025-4F5E-A196-C83556B8EDC6@gmail.com>
- Reply-to: lojban@googlegroups.com
- Sender: lojban@googlegroups.com
Feel free to come find me on Libera IRC, or suggest a preferred chat
option for you.
The stuff I want is actually quite simple, though:
(1) I want to confirm that camxes-py is the preferred Python option
these days
(2) I want to be able to run "run" (see
https://github.com/teleological/camxes-py/blob/master/camxes.py#L89
) or something like it in a direct, straightforward way, i.e.:
import camxespy
tree = camxespy.run("mi klama", transformer='camxes-morphology')
, and tree should contain an obvious python representation of the
parse tree.
This requires, AFAICT (I don't actually know Python very well) that
camxes-py have a library struture to it that it doesn't currently
have and that the options be configurable in some way other than
OptionParser.
I can actually do all that myself, but I'm not really a pythonista
and what I do won't be idiomatic at all.
Stretch goals:
(3) Update to most-recent parsimonious; it currently breaks on
0.8.1, but works on 0.6.2
(4) Update to Python 3, but I'm perfectly capable of making a PR for
this myself.
(5) Make a mode that collapses productions with only one child, i.e.
make the output look like this (in terms of productions not syntax):
rlpowell@stodi> echo "mi klama" | camxes -f
Flat layout requested.
text=( sentence=( CMAVO=( KOhA=( mi ) ) BRIVLA=( gismu=( klama ) ) ) )
Instead of this:
root@66324b4aed4b:/src# python camxes.py "mi klama"
["text",["text_1",["paragraphs",["paragraph",["statement",["statement_1",["statement_2",["statement_3",["sentence",[["terms",["terms_1",["terms_2",["abs_term",["abs_term_1",["sumti",["sumti_1",["sumti_2",["sumti_3",["sumti_4",["sumti_5",["sumti_6",["KOhA_clause",[["KOhA","mi"]]]]]]]]]]]]]]],["CU"]],["bridi_tail",["bridi_tail_1",["bridi_tail_2",["bridi_tail_3",["selbri",["selbri_1",["selbri_2",["selbri_3",["selbri_4",["selbri_5",["selbri_6",["tanru_unit",["tanru_unit_1",["tanru_unit_2",["BRIVLA_clause",[["BRIVLA",["gismu","klama"]]]]]]]]]]]]]],["tail_terms",["VAU"]]]]]]]]]]]]]]]
, but as I said before this is not hard to do after the fact once
you have the parse tree.
On Fri, Aug 27, 2021 at 11:15:54PM -0400, Riley Martinez-Lynch
wrote:
> Robin, I'd be happy to make whatever changes are needed to make it
> work. I don't see the CLI interface as an essential part of the
> interface, and if I can do something to make it easier to access
> programmatically, I'd like to do that. Glad to take cues here, or
> if you wanted to jump on a call or chat, can do that too.
>
> Sent from my iPhone
>
> > On Aug 26, 2021, at 10:11 PM, Robin Lee Powell <robinleepowell@gmail.com> wrote:
> >
> >
> > In service to making certain parts of the lojban.org infra a bit
> > more resilient, I'm updating some stuff that uses
> > https://github.com/lojban/python-camxes . This relies on java and
> > the camxes jar, which, whatever, but it's also built on LEPL, which
> > no longer works (see for example
> > https://github.com/modoboa/modoboa/issues/1780 ).
> >
> > https://github.com/teleological/camxes-py is a pure Python
> > replacement, but is a CLI program rather than a library; it's really
> > not designed to be used as a library. I'd love it if someone
> > updated and fixed that.
> >
> > Unless there's another option? What's the state of the art in this
> > space?
> >
--
You received this message because you are subscribed to the Google Groups "lojban" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lojban+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lojban/20210828040224.GS309000%40gmail.com.