https://futureofcoding.org/ logo
#thinking-together
Title
# thinking-together
j

Jason Morris

05/24/2023, 8:57 PM
I am going to need to come up with a more robust way to allow my users to edit legislative text in a way that is user friendly, and forces them to stick to a predefined data structure. I'm wondering if anyone has tried to use tools like slate.js or ProseMirror for that sort of thing, or have other suggestions. It's legislation, so I want the editing environment to be as text-like as I can manage.
g

greg kavanagh

05/27/2023, 10:42 AM
I’ve had great experiences with codemirror. It allows you to describe a syntax with a package called Lezer. It can be a bit of a nut to crack but the creator is incredibly responsive.
j

Jason Morris

05/30/2023, 4:20 PM
Thanks for that, Greg. Hadn't heard of Lezer, so I will check it out. I've been playing with ProseMirror a little further, and it looks really promising. People have been working on automating generating ProseMirror configurations (partly) from XML schema documents, which is an enormous upside for me, so I'll probably dig deeper. Do you know if they are related to each other other than in name? The prosemirror system has a very syntax-centric method of configuring it, so it wouldn't totally surprise me.
g

greg kavanagh

05/30/2023, 4:26 PM
Looks like it’s the same developer!
a

alltom

06/11/2023, 7:43 PM
I came across your thread just after reading https://writings.stephenwolfram.com/2023/06/prompts-for-work-play-launching-the-wolfram-prompt-repository/, so recency bias yada yada, but this does strike me as a situation where an LLM could help, particularly with learnability. The prompts I saw in the article that make me think it are: • Anonymize replaces parts of the text that look like identifiers with placeholders • CSV causes the LLM to structure its answer as CSV They lead me to believe that a prompt could reformat its input to match your structure(s?). So, no change when it matches, but a humanlike reinterpretation otherwise. On one end of the interface spectrum, you might allow free text. On the other, you invoke it whenever there’s a parse error, to suggest an interpretation that does match your desired structure. Either way, showing the parse would teach the language and potentially make it faster to write. Not saying it wouldn’t take a ton of fiddling, since I don’t know. Just throwing it out there. :)
j

Jason Morris

06/11/2023, 8:05 PM
I'm not sure I understand the suggestion... Use an LLM to accept a potentially ill-formed XML document and correct it automatically?
a

alltom

06/11/2023, 8:11 PM
Oh, the structure is XML? Okay, nm. I massively misinterpreted your initial post.
j

Jason Morris

06/11/2023, 8:13 PM
Fir enough. This is what I've managed to build using ProseMirror over the last couple of weeks. It's essentially useless for data entry except in debug mode, and even then there are a lot of issues to avoid. But it proves the concept, and with another couple of days of work it would probably be usable enough to replace the markdown-like tool I'm using now.
6 Views