-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add !!word functionality #1083
Add !!word functionality #1083
Conversation
Here is more info on the disjunct display (that is not yet documented in the help file).
The displayed disjuncts (4273 ones) are after duplicate elimination. Flags may come after the last I can add a flag to show the source macro for each connector. However, I don't know in which format to display that. One possibility is to use the rest of the line (after the connectors). This will cause the lines to be very long and to fold, but it will make filtering by For expression display, there are 2 flags (documented in the help files). I can add more, but I don't know how much it is useful. For example:
|
I said above:
The code for wordgraph display can be reused in BTW, I now think it could be a design error to invoke the wordgraph display process from within the library. Instead, the API call could just return a string in the DOT language and leave it for the UI ( |
Forced-push with 2 cleanups. |
The created expressions are different in DEBUG and non-DEBUG modes, so something bad happens. |
ok |
I fixed the problem (introduced in PR #1079) ) in commit "make_expression(): Fix comparing to the wrong Exp field". BTW, in the forced-push commit display, the commits are not in the same order as in my git branch. I hope this doesn't have bad implications. This PR can be applied now. |
For these I still need your input:
|
Don't split it.
So, |
? Would would that marking look like? Isn't shallow/deep already more-or-less explicit with |
Yes, this would be nice. One could show the deepest macro only, or show the whole macro chain. So, for example,
Let pretend this is wrong. Why is it wrong?
Gee, I think that
Well, that doesn't work because I cannot cut-n-paste from the disjunct display to the regex search ... But lets pretend that this worked ... ideally, I would see something similar to this:
I used both indentation, and parenthesis above, but I think only one or the other is needed (the indentation is the same as the open-paren count). Its probably easier to read without the parens. With the above printout, I can immediately jump to the correct locations in the dictionary, and study how or why they might be right/wrong. The biggest problem with this suggestion is that
so I'm confused about that (let's pretend I'm a naive user and never really how to use a regex, except for very simple ones...)
oh wait, is deep-shallow ordering reversed?
Argh! regex is confusing. BTW, I think the typical use case will be to search for one disjunct only. I think that wild-card searches will be uncommon, and I cannot imagine using regex, even if it worked well... (but its late at night and I'm sleepy so my imagination is impaired). |
This is the order as produce by
When you filter by regex, change max_cost, or apply a dialect, the numbering is redone. |
In
Example from the demo output (the ones ending with the |
It is also possible to show the expressions with cost cutoff (same as done with disjuncts), in which case they are more compact. This may be useful because it will show only what is actually used. |
In any case the
Because the default regex engine is PCRE (I guess it is installed in your system, actually PCRE2 if installed), you can preceed the regex with
The problem is that the disjunct display doesn't include the connector signs. Possible solutions:
Using solution(), one could do (using flag
The deep-shallow ordering of expressions and disjuncts is indeed different... It was always so in the library disjunct and connector-list display code. This makes a problem for cut&paste, unless, for example, the
Here are a useful regex searchs:
However, if the regular searches are expected to be of literals, a flag |
OK, clarifications:
So, this is a bug: the printout should match the same order as what is in
I'm fairly certain that 90% of all dictionary debugging flow will work like in the "this is a big test" example. So this is the flow that must be natural, easy-to-use, and obvious. I don't mind using By contrast, these two I like:
and
and both should be mentioned in
I think I like solution 1 the best, mostly because it takes the least amount of work/effort (least amount of reading the docs). |
I will make the printout of disjuncts and connector lists consistent with expression order. Only debug output is involved - not anything with official API output. I will also implement the rest according to your above post. |
This PR makes intensive changes in order to help debugging of dictionary expressions.
This is important for the next changes, that may need such debugging.
The added functionality is documented in
!help !
.Also, I added the following in
command-line.c
:!help !
).!help
.(Changes may be needed to make it clearer.)
I looked at the macro annotation of
test.n
andtest.v
, and several macros appear more than once.It may be intentional but it looks suspected.
The disjunct list also have many entries that seems strange to me (especially those with duplicate disjuncts).
Note also some very strange high costs. This happens due to the "strange" algo used for cost cutoff. I checked in 5.0.8 and the generated disjunct lists are the same (for the same expressions) per given
!max-cost
(i.e. the same high costs). In case such disjuncts are not useful, they just slow the parsing.Main changes:
!cost-max
.!dialect
).!
.!<macro>
clean display.Forced-push to update the help text.