Project origin - jzohrab/lute GitHub Wiki


This documentation is deprecated/obsolete. Lute v2 has been replaced by Lute v3, a full Python rewrite. Please see the Lute v3 manual which includes notes on installation. If you have Lute v2, you can easily migrate to v3. Thank you!


Why the fork?

TL;DR: I felt that LWT was an extremely important idea, but I felt that its implementation made it hard to fix problems, and created barriers for its improvement.


I started using Hugo Fara's fork of LWT in Oct/Nov 2022. I submitted a few patches, but Hugo wanted to put things on hold as he dreamed up another version of LWT.

  • Initially, I just wanted a new feature: adding "parent terms" to terms. To me, it doesn't make sense to think of a conjugated form of a verb ("I speak", "yo hablo") as a separate thing from the root form ("to speak", "hablar"). I added the feature to LWT, but it was very tough.
  • There were some bugs in LWT that were impossible to track down. For example, when adding multi-term expressions, LWT would sometimes find them, and sometimes miss them. Lute corrects those issues, and adds a series of automated tests to help track down those problems.
  • As a former dev, there were some things about LWT that I simply couldn't get behind: lack of automated testing, tough database management, tough architecture, etc. Per the author at https://learning-with-texts.sourceforge.io/: "My programming style is quite chaotic, and my software is mostly undocumented." That's what happens when you create a brand new system -- Lute takes advantage of the things learned in that code and in Hugo's fork to create a reasonably solid starting point.

Moving to Symfony

Originally, I had hoped to restructure the code per the ideas in on-structuring-php-projects, but then felt that this was just delaying the much-needed massive code rewrite.

I started to introduce a "no framework" restructure, per the "no framework" tutorial, but after a few steps I felt that I was merely re-implementing the Symfony framework.

I looked at a few frameworks (laravel, yii), and based on gut feeling only, went with Symfony.

Overview

Fundamentally, it appears to me that the LWT code really consists of a few core things:

  • parsing texts into tokens, which users can then mark as "words" for known topics.
  • the reading pane, where users interact with texts.

It appears that the data model for the above is decent: texts, words, textitems2, etc are decent structures (even if some of the table names are odd, for historical reasons). There's no need to change much there.

The parsing and pane interaction have some hairy javascript, php, and sql, so those just need some more tests to ensure things are good.

Pretty much everything else is just "CRUD" (i.e., it's a simple database "Create-Retrieve-Update-Delete" app). Most of that can be handled with simpler code, or generated code.

Final note

Even if Lute doesn't become "the new LWT" that I hope it can be, perhaps it will be useful as a reference implementation.

⚠️ **GitHub.com Fallback** ⚠️