Return-path: Envelope-to: lojban-list-archive@lojban.org Delivery-date: Fri, 27 Aug 2021 21:02:33 -0700 Received: from mail-pf1-f187.google.com ([209.85.210.187]:57068) by stodi.digitalkingdom.org with esmtps (TLS1.3) tls TLS_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1mJpY5-00Fjc2-9I for lojban-list-archive@lojban.org; Fri, 27 Aug 2021 21:02:33 -0700 Received: by mail-pf1-f187.google.com with SMTP id h10-20020a056a00170a00b003e31c4d9992sf639145pfc.23 for ; Fri, 27 Aug 2021 21:02:29 -0700 (PDT) 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-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-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 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state: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:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=8UoEUOAROkybiNKkTO14G4CF1Soa2TDA/Jz460baP9k=; b=UnGcLDRm3hX8HGSTSY041lSdxe0Y/seBABlFrBHM6Rqp5GpMpPDp30+UebzJs+fVtu 1MFyARQWcXSRBSqnMCLxVbRGf149Czmi6ez+rSN1ClHiNjRD18s/uIo3SY47Yjl2D8i1 Jsl1bcOt2d6C9u/uxJ5eddiXIvG/nx8kGlJ8PC9ixzl6lGinik7WxdIrSlk9gIlZTFXK p6UsCSb2kBSBHvTnRKioXXgbbJUVXAhq8nDPvztqSfr7K3KqWE+Jx3mPvDr37NbUEP1+ vAei9vUIqNGvzGfuLti8uasGsu3KA4mS12QtM1Hrz2BwkirO/hi1cTdLsggZ7VaOhVsr wXiw== Sender: lojban@googlegroups.com X-Gm-Message-State: AOAM532zX3EkG6VfM9OpOo1qcST3btwSKijhwQW4PFxbjOdZfvNaqe93 qhcV5KF3ffSb90Ex49mnvPQ= X-Google-Smtp-Source: ABdhPJxd7B67YABpKoGDXNi4qoUwazGBl1Do8h0QCIdxcXmVsuDj7BudcnhSVaCIs4NV/ZxCTRkcAA== X-Received: by 2002:a17:90a:bb13:: with SMTP id u19mr26412081pjr.42.1630123348136; Fri, 27 Aug 2021 21:02:28 -0700 (PDT) X-BeenThere: lojban@googlegroups.com Received: by 2002:a17:902:e845:: with SMTP id t5ls5732724plg.9.gmail; Fri, 27 Aug 2021 21:02:27 -0700 (PDT) X-Received: by 2002:a17:902:bd88:b0:130:1c3d:4c02 with SMTP id q8-20020a170902bd8800b001301c3d4c02mr11758726pls.80.1630123347528; Fri, 27 Aug 2021 21:02:27 -0700 (PDT) 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== 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-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 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com. [2607:f8b0:4864:20::529]) by gmr-mx.google.com with ESMTPS id c23si522350pls.5.2021.08.27.21.02.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Aug 2021 21:02:27 -0700 (PDT) Received-SPF: pass (google.com: domain of robinleepowell@gmail.com designates 2607:f8b0:4864:20::529 as permitted sender) client-ip=2607:f8b0:4864:20::529; Received: by mail-pg1-x529.google.com with SMTP id e7so7779801pgk.2 for ; Fri, 27 Aug 2021 21:02:27 -0700 (PDT) X-Received: by 2002:a63:dd0e:: with SMTP id t14mr10696731pgg.279.1630123346866; Fri, 27 Aug 2021 21:02:26 -0700 (PDT) Received: from gmail.com (mail.digitalkingdom.org. [173.13.139.236]) by smtp.gmail.com with ESMTPSA id w14sm4514734pge.40.2021.08.27.21.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 21:02:26 -0700 (PDT) Date: Fri, 27 Aug 2021 21:02:24 -0700 From: Robin Lee Powell To: Riley Martinez-Lynch Cc: lojban@googlegroups.com Subject: [lojban] Re: Help parsing Lojban from Python? (Hey, Riley! :) Message-ID: <20210828040224.GS309000@gmail.com> References: <20210827021139.GO309000@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Original-Sender: robinleepowell@gmail.com X-Original-Authentication-Results: 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 Reply-To: lojban@googlegroups.com Precedence: list Mailing-list: list lojban@googlegroups.com; contact lojban+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: lojban@googlegroups.com X-Google-Group-Id: 1004133512417 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -2.5 (--) X-Spam_score: -2.5 X-Spam_score_int: -24 X-Spam_bar: -- 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 =3D camxespy.run("mi klama", transformer=3D'camxes-morpholog= y') , 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=3D( sentence=3D( CMAVO=3D( KOhA=3D( mi ) ) BRIVLA=3D( g= ismu=3D( 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",["a= bs_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",["s= elbri_1",["selbri_2",["selbri_3",["selbri_4",["selbri_5",["selbri_6",["tanr= u_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. >=20 > Sent from my iPhone >=20 > > On Aug 26, 2021, at 10:11 PM, Robin Lee Powell wrote: > >=20 > > =EF=BB=BF > > 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 ). > >=20 > > 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. > >=20 > > Unless there's another option? What's the state of the art in this > > space? > >=20 --=20 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 e= mail to lojban+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/= lojban/20210828040224.GS309000%40gmail.com.