libera/#commonlisp - IRC Chatlog
Search
11:01:38
Colleen
lisp123: Guest74 said 21 hours, 46 minutes ago: I think I'm going to make a github with all the Moby files as I had to dig them out of archive.org. They're also at project gutenberg but they rather stupidly present the readme's as the text so you have to dig and get the links to an ftp site.
11:04:08
lisp123
Guest74: based on your later comments, not sure how useful this resource this...I rather a smaller base, but more quality
11:13:42
Nilby
lisp123: what do you want to use continuations for? also "On Lisp" shows one way to do them
11:21:09
lisp123
Nilby: Yes, I've implemented the On Lisp continuations, quite good but some slight deficiencies
11:21:39
lisp123
Continuations are quite useful when writing Artificial Intelligence programs (where Lisp excels)
11:35:43
Guest74
lisp123: https://github.com/JMC-design/Moby depends on what your needs are. Either way, I've got parsers for most of the stuff there, so you can take an easier look at the data.
11:41:56
Guest74
So Norvig wrote this https://norvig.com/spell-correct.html , and someone copied it quite literally into CL. I'm not sure what constitutes a good spell checker, but this is a spell checker.
11:45:06
Guest74
I couldn't test with the data he did, but I ran the same tests as Aspell http://aspell.net/test/cur/ and the cl version came up around 45%.
11:46:25
Guest74
at the same time, it got almost everything right given as examples in journal articles for 'difficult' cases.
11:49:00
Guest74
So if someone is interested in spell checking this might be a good place to start. I'd think less brute forcing might be nice, testing for hand shift on the keyboard, only checking a keys neighbours instead of every character, and for those who want to through context in, there's a really good data set of word frequencies and 4-5 n-grams by
12:03:47
beach
And, yes, if I accidentally hit a neighbor key, then my word will look like the one pjb just showed.
12:06:53
beach
I guess when a virtual keyboard is used, like on a phone or a tablet, then adjacent keys are easier to hit.
12:13:21
Guest74
there's also when you're too excited and you forget that your hands work at different speeds so you get all or most of one hands letters.
12:14:15
Guest74
beach: and I think I good spell checker would take that into account, allow you to turn on or off certain types of checking.
12:14:18
beach
Indeed. I seem incapable of typing "the" for instance. It always comes out as "teh", so in fact I have an Emacs abbrev to fix it.
12:17:38
lisp123
Guest74: I would just have a standard dictionary, but if you repeat certain words it remembers that that might be acronym or some other term it doesn't know
12:17:55
Guest74
For single shifts or omissions I think there might be some merit to exploiting the trie structure as you'll naturally hit a dead end as you traverse and that would seem a likely spot for the error.
12:18:17
lisp123
But the way we are headed, its less about spell checking and more about input completion - microsoft produts now suggest responses based on context
12:19:11
Guest74
I really would like acronyms to be separate, so if you see something all caps, check there.
12:21:32
lisp123
I've been working on editors, and one thing I'm doing is to try to expose options for the user to choose between alternate sets of inference (in this case for spell checking) rules
12:22:58
Guest74
As for more curated dictionaries, I plan on parsing I think websters 1911 because things like 9 a clock are cool, and then the project Gutenberg dictionary. to start.
12:26:17
Guest74
beach: yes, i'm looking up if there's some existing classification system for spoken dialects to label pronounciations with a source including time and region.
12:28:50
Guest74
my personal use case is I'd like to collect pronounciations to be used in speech generation. And having an easy way to say you want a texas drawl from the 1800s would be nice.
12:32:59
Guest74
dbotton: do you have a link? though unless there's some automated way to encode that in a suitable phonetic alphabet...
12:34:37
Guest74
mfiano: See, that's the stuff I'm interested in. Not spellchecking. Besides, it seems way simpler.
12:42:01
Nilby
if i just would have collected all the spell checker suggestions and the one i chose, i could have trained a thing by now
12:48:57
Nilby
yes. but it would probably only work right for me. and why wait a lifetime for spellchecker
12:50:37
Guest74
I'm a strong believer in being able to run a desktop without an internet connection.
12:51:45
pjb
Guest74: also, with the developpment of centralized AI backed systems, it'll be more and more difficult.
13:06:59
pjb
Or just use free software, and patch it and compile it yourself to work as you want on the targets you want.
13:08:16
Guest74
Anyways, I think you could do a decent job of spell checking with a core of frequencies of ~10k most popular words with trigrams. that could be augmented with domain specific thesauri
13:10:27
Guest74
And even the trigrams aren't absolutely necessary. Word frequency helps you to decide which is the most likely spelling. I'm pretty sure most people who write things can pick the proper spelling of the word they want from a list of candidates.
13:12:29
jackdaniel
deploy software and each time someone corrects themself add the pair to the dictionary ,)
13:21:29
Guest74
What someone should really do is just implement Aspell's algorithm in CL and then have access to tons of languages. Me all just move ahead with filtering candidates based on pos and pronounciation for english.
14:30:49
Guest69
Hello, does anyone know how to declare one of the bindings as ignorable in the classic once-only macro? I'm having trouble with it: https://pastebin.com/2NsqwHK9
14:31:57
Bike
i think you just don't quote it? quoting it obviously won't work, that'll just be discarded
14:32:40
jackdaniel
the short answer is: you can't, you need to define your own once-only* macro, because that's the macro that estabilishes the block context
14:33:05
Guest69
That's what I was fearing without wanting to delve in what is still dark magic to me (once-only content)
14:34:53
Guest69
Hmmm? Aren't they lower-level, i.e. used by once-only to evaluate stuff once and put it in a gensym?
14:35:29
jackdaniel
I wouldn't call them exactly lower level, they address another potential issue with macros, that is the variable capture
14:37:39
jackdaniel
also, re your original question, you may estabilish a local declaration context with the operator locally
14:41:44
jackdaniel
you may also get silly and do (once-only (a) `(let ((,a ,a)) (declare (ignorable ,a)) 2))
14:55:47
Guest69
Related question: does everyone fumble with horrible quasiquote contraptions in macros when you want optional list splicing (to construct function argument lists, mostly)?
15:07:26
beach
Guest69: That's pretty normal, but you should have an explicit `else' branch for your IF with '().
15:08:20
jackdaniel
sure, there is sometimes a need to do that, I'm usually doing ,@(and foo (list :foo foo))
15:08:53
beach
Because the convention is for IF to be used for value, and then an explicit else branch is, well, more explicit.
15:08:58
jackdaniel
no, ,@nil is well defined, beach talks about style; usually one-arm if is replaced with WHEN or UNLESS
15:09:30
beach
Yes, that, but then WHEN and UNLESS are used in a context when the value is not needed.
15:10:24
jackdaniel
IF with superficial NIL adds plenty of clutter, AND sounds like a better alternative
15:10:46
jackdaniel
Guest69: there is a style guide written by Pitman and Norvig that has numerous useful advices
15:10:55
Guest69
Let's say that Tcl's {*} spoiled me when it comes to constructing arg lists in place
15:14:31
jackdaniel
that said people often use implicit return values and that often makes code more readable (at least to me)
15:14:50
jackdaniel
the conclusion in this poem https://people.cs.uchicago.edu/~wiseman/humor/large-programs.html strongly resonates with me ,)
15:22:05
Nilby
quasi-quoting was quasi-hard for me until a got quasi-good at it, but i still get quasi-confused by quasi-overusing it ,@,`,',@,
15:24:13
Guest69
By the way, any other way than apply when not in macro-expansion to achieve the same effect?
15:25:20
jackdaniel
Guest69: `(something '(,@var)) and `(something (list ,@var)) are different because the latter does not prevent evaluation of forms in var
15:26:08
Nilby
i'm always to lazy to write another similar function, so i write a very complicated set of macros to do it for me
15:26:50
Bike
sounds cargo culted. sbcl will compile (foo ...) and (funcall #'foo ...) identically for the most part
15:27:10
Bike
the other operator you can use to give functions variable arguments is multiple-value-call, but it's a pretty special operator
15:27:58
Bike
apply is more involved than funcall, but not enough that you should worry about it in most circumstances. consing up lists to give to it might take some time, though
15:28:59
Guest69
Fun coincidence, I just used multiple-value-call 1 minute ago to write a map-img for opticl
19:51:58
thuna`
Does anyone know why I am getting "Failed to find the TRUENAME of /tmp/packages.lisp" when doing (asdf:load-system)?
19:53:04
Bike
you're loading a system in /tmp that includes a packages.lisp but there is no such file?
19:56:40
Bike
i mean, kind of anything? what's in tmp, what system you're loading, what the definition of that system is, where asdf is looking for the system, what you are trying to do overall, etc
20:08:05
thuna`
Bike: I shouldn't be doing anything out of the ordinary. I have a .asd file in a directory with the other components and I'm trying to load it using load-system from the Slime repl. The tmp folder doesn't have anything interesting
21:12:33
jackdaniel
thuna`: you probably compiled asdf:defsystem with C-c C-c, temporary file got placed in /tmp/ and the base path were set invalid