How I Added an LLM-Based Grammar Checking + TeX Math Import To LibreOffice (keithcu.com) 42
Former Microsoft programmer Keith Curtis "wrote and self-published After the Software Wars to explain the caliber of free and open source software," according to his entry on Wikipedia, "and why he believes Linux is technically superior to any proprietary OS."
He's also KeithCu (long-time Slashdot reader #925,649), and has written a blog post on "How I added an LLM-based grammar checking + TeX math import to LibreOffice." : At Microsoft, I spent five years working on the text components RichEdit and Quill, and came to understand the "physics" of word processing: the file formats, data structures, and algorithms that provided fast access to text and properties, independent of the length of the file. Selecting one million characters to make them bold took about the same time as changing one character, because of the clever data structures (piece tables) and algorithms in these engines...
When I decided to add a real-time AI grammar checker to [LibreOffice plugin] WriterAgent, I knew what I was getting into, but I underestimated the trickery of LibreOffice's UNO.
His site shares the surprises he encountered, one by one. (Starting with "the office suite throws a bunch of initialization variables at your constructor. If your Python __init__ method doesn't handle them, the code fails to map the call, the stack misaligns, and the program dies.") There's sentence casing issues, duplicate words, and foreign-language syntax — all culminating in new features for "a LibreOffice extension (Python + UNO) that adds generative AI editing to Writer, Calc, and Draw..."
"If you want to try it out, the repo is here... Let's make LibreOffice and the free desktop AI-native!"
He's also KeithCu (long-time Slashdot reader #925,649), and has written a blog post on "How I added an LLM-based grammar checking + TeX math import to LibreOffice." : At Microsoft, I spent five years working on the text components RichEdit and Quill, and came to understand the "physics" of word processing: the file formats, data structures, and algorithms that provided fast access to text and properties, independent of the length of the file. Selecting one million characters to make them bold took about the same time as changing one character, because of the clever data structures (piece tables) and algorithms in these engines...
When I decided to add a real-time AI grammar checker to [LibreOffice plugin] WriterAgent, I knew what I was getting into, but I underestimated the trickery of LibreOffice's UNO.
His site shares the surprises he encountered, one by one. (Starting with "the office suite throws a bunch of initialization variables at your constructor. If your Python __init__ method doesn't handle them, the code fails to map the call, the stack misaligns, and the program dies.") There's sentence casing issues, duplicate words, and foreign-language syntax — all culminating in new features for "a LibreOffice extension (Python + UNO) that adds generative AI editing to Writer, Calc, and Draw..."
"If you want to try it out, the repo is here... Let's make LibreOffice and the free desktop AI-native!"
Shut up (Score:1)
Re: (Score:2)
Does it connect to the RUMP watch [fastcompany.com]?
And for the low low price of twenty bucks (Score:1)
You can actually make use of it, or you are on your own, you already know about local LLMs don't you?, anyway pay em $20-$2000 each and every month forever and it will work great.
Re: (Score:2)
No need for 20 bucks.
Open/Libreoffice has had TeX integration for years: https://extensions.libreoffice... [libreoffice.org]
It works and very well, too.
OO/LO has had grammar check for a lot longer than TeX support.
Re: (Score:2)
Re: (Score:2)
I've never heard of Overleaf.
We already had grammar checking (Score:5, Insightful)
OpenLibre already had grammar checking. It was free, didn't require a lot of hard drive space (a few MB at most?), and ran locally and almost instantly without needing a high price graphics card.
In fact we've had that ability for over a decade now.
> Let's make LibreOffice and the free desktop AI-native!
Fuck you, Keith.
=Smidge=
/TexMaths is also an existing LibreOffice extension
Re: (Score:2, Interesting)
Re: (Score:2)
Re:We already had grammar checking (Score:5, Insightful)
I spend $0 a month on word processing and I'm more concerned with the product of my efforts than developing my own tools. It's almost as though new solutions to long solved problems is all that matters here, not actually editing documents.
Re: (Score:2)
Re: We already had grammar checking (Score:2)
By implication, some people are tools. :-)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
As I said above, depending on the model, you can get far more sophisticated grammar advice than the conventional limited static systems
I don't know why I would want that. Is it aimed at foreign language speakers?
Re: (Score:2)
Re: (Score:2)
I was shocked at some of the interesting advice I got when using frontier models, and getting great advice on the ones below that.
Wow, the models were shocking with their shocking advice.
Do you have any examples of what was so shocking?
Re: (Score:2)
Maybe I'll try and do comparative testing vs LanguageTool, etc. and see how it does. Do you have a big mess of bad text I could use as a test set?
It's only about 2,500 lines of code for a lot of features (sentence cache, persist with document, intl, etc.)
Re: (Score:2)
Yeah, we've had grammar checking for nearly 3 decades now. And for the most part it's been mostly useless - tell me if it doesn't complain about anything other than "passive voice" over and over again. Oh, it got better, it gave examples! But it was the same old crap over and over again that I stopped caring about the blue squiggle. I think most programs disable the blue squiggle on grammar errors nowadays.
But I've noticed it in a few places and it doesn't bother telling me what's wrong, but offers me a hel
can we have section breaks next (Score:2)
Re: (Score:2)
Re: (Score:2)
"It's actually creating a new industrial revolution so it's better to have a positive attitude about it, but whatever. "
It is not, but we can assume where you have money invested.
"One of the first features I really liked is that I can select a mess of text (even with random extra markdown formatting characters), and tell the AI clean it all up and make a pretty table out of it."
So you're an AI slop producer.
"Sure, I could do that myself, but it's a PITA. The problem of slop will get better..."
And is it real
Re: (Score:2)
Re: (Score:2)
"AI" proponents keep touting language translation as something LLMs do well, yet they're absolutely dreadful at it for pairs of languages I'm familiar with. "AI" translation cannot get pronouns right when translating to/from languages where pronouns depend on the relationship between the speaker and listener (e.g. Korean and Viet). Admittedly it can be ambiguous if you only have a single sentence, but "AI" doesn't get better with more context. Give it enough material that it's unambiguous to any human, a
Re: (Score:2)
Very long time fluent speaker / daily writer of business Japanese here. I also worked as a professional JP to EN translator so am very familiar with translation issues. I have found Claude Opus to be extremely helpful in two situations:
1) Reviewing Japanese email / document I have written.
- Finds typos
- Gives good advice (sometimes too stiff so I don't listen anyway)
- Points out awkward phrasing and offers better. It does follow some patterns too frequently, and sometimes it stops sounding like me. Yes I wo
Re: (Score:2)
The trick is not to choose the right tool for the task. Many US LLM for example suck at European languages, but Mistral (and suprisingly Gemma) do much better. I'd think if you want Korean as target language EXAONE is worth a try, because LG is a Korean company, so it probably knows more Korean grammar than the typical US LLM does.
Re: (Score:2)
Ignore the not. I changed the phrasing and forgot to remove it. The Trick *is* choosing the right LLM.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
AI is a tool with many uses. It's actually creating a new industrial revolution so it's better to have a positive attitude about it, but whatever....
I don't know why you think that calling it a new industrial revolution should make people feel better, or why people should adapt to it rather than fighting it. The industrial revolution eventually improved lives for many people, but it also came with a horrific price. People, including children, were forced to work in dangerous conditions that they rarely encountered while working on a farm. The lack of infrastructure led to breakdowns in sanitation, and spread of deadly diseases. The life expectancy in Li
Re: (Score:2)
Come join!
We aren't going back to children working in factories. Marxism happened because it's taught in colleges. Economists can be wrong for 50 years without consequence, unlike programmers. (Unless you invade a country
Re: (Score:2)
You don't use LO because an unaffiliated third party wrote a plugin you don't like?
That's completely fucking insane.
Re: (Score:2)