Tesseract ambiguity files work different for editing - tesseract

I want to edit some text like Female and Male because When I test them I found them as FemaIe and MaIe (I mean with Capital I not small L (l) ). And I want to solve this issue using ambfile like;
v1
6_tab_F_e_m_a_I_e_tab_6_tab_F_e_m_a_l_e_tab_1
4_tab_M_a_I_e_tab_4_tab_M_a_l_e_tab_1
But When I retest my results , they were worse. I found the Female as F and Male as M.
What I am doing wrong ? To use amb file like that is a wrong idea?

The fields should be tab separated, according to Tesseract Training Wiki.

Related

Are there unicode symbols for entering basic electrical symbols from multimeter?

I have a markdown file that has some of notes related to basic testing with a multimeter. I know I can use the capital Omega symbol (U+03A9) for Ohms but for a lot of the other symbols, I haven't found any good options other than either showing a picture, linking somewhere else, or trying to verbally describe the shape of the symbols.
I was planning to share with a friend that has ZERO electrical background without them needing more than a browser (e.g. probably putting it on github/gitlab/etc and linking them the document). I know I can always just link to another page or resort to pictures but was kind of curious if there's actually a better way of doing this that would allow me to use the symbols in-line during steps of written instructions (e.g. Turn the multimeter to the "XYZ" symbol (which means "ABC"))
With Unicode having all sorts of math symbols and even some things that look a bit like emojis, I was kind of expecting to find at least basic electronics symbols there too. The most important one for me right now is the "Continuity" symbol as it might appear on Fluke and similar multimeters (I know they could probably figure it out from ))))) but I guess I'm just OCD because that doesn't really look the same to me at all). But if I can get them interested, I would probably end up wanting to reference symbols for "Volts AC", "Volts DC", "Diode test", "Capacitance", etc too. So far, all of my searches have been coming up empty. Am I just missing them? Are there some other glyphs I could put together for rough appropriations? Is there some other, better approach for writing these that I'm completely unaware of?
Thanks in advance.
Not happy with my own answer, so if you have a better one, please post... but so far, the best I've been able to come up with, without resorting to pictures, is:
Multimeter symbol
Unicode
Github Markdown syntax
Displays as
AC Voltage
U+007E(tilde)
V<sup>~</sup>
V~
DC Voltage
U+2393
V<sup>⎓</sup>
V⎓
AC/DC Voltage
U+2242
V<sup>≂</sup>
V≂
AC/DC milliVolts
U+2242
mV<sup>≂</sup>
mV≂
Ohms
U+2126
Ω
Ω
Continuity
U+0029
)))))
)))))
Diode Test
U+2015,U+2BC8,U+22A2
―⯈⊢
―⯈⊢
Capacitance
U+22A3,U+276A,U+2015
⊣❪―
⊣❪―
AC Amperage
U+007E(tilde)
A<sup>~</sup>
A~
DC Amperage
U+2393
A<sup>⎓/sup>
A⎓
AC/DC Amperage
U+2242
A<sup>≂</sup>
A≂
I suppose you could also just drop the superscripts and use the AC, DC, or AC/DC symbols right next to "V" / "A" as that would slightly improve visibility since the glyphs would be just a little bit larger.

Functional q-SQL: How to translate the fby part of the parse tree

When I run parse"select from trade where date=max date,price=(max;price) fby sym"
I get the following parse tree:
</br>
?
`trade
,((=;`date;(max;`date));(=;`price;(k){$[(#x 1)=#y;#[(#y)#x[0]0#x 1;g;:;x[0]'x..
0b
()
I tried interpreting this in functional form as:
?[trade;((=;`date;(max;`date));(=;`price;(k){$[(#x 1)=#y;#[(#y)#x[0]0#x 1;g;:;x[0]'x..;0b;()]
but I get an error pointing to the final. What is wrong with my syntax?
You have two issues here. First is that your display window is not wide enough to show the full output. To adjust this window use \c (console size) command:
q)\c 25 200
q)parse"select from trade where date=max date,price=(max;price) fby sym"
?
`trade
,((=;`date;(max;`date));(=;`price;(k){$[(#x 1)=#y;#[(#y)#x[0]0#x 1;g;:;x[0]'x[1]g:.=y];'length]};(enlist;max;`price);`sym)))
0b
()
However, you will still have an issue using this because parse displays the full underlying k definition of fby:
q)fby
k){$[(#x 1)=#y;#[(#y)#x[0]0#x 1;g;:;x[0]'x[1]g:.=y];'length]}
Note that the definition is prefixed with "k)", which causes the error. To get around this you'll want to entirely replace the the k definition above with fby so that you have
?[trade;((=;`date;(max;`date));(=;`price;(fby;(enlist;max;`price);`sym)));0b;()]
rather than
?[trade;((=;`date;(max;`date));(=;`price;(k){$[(#x 1)=#y;#[(#y)#x[0]0#x 1;g;:;x[0]'x[1]g:.=y];'length]};(enlist;max;`price);`sym)));0b;()]
You can use fby rather than the k definition from parse:
?[trade;(((=;`date;(max;`date));(=;`price;(fby;(enlist;max;`price);`sym))));0b;()!()]
As suggested by Aaron Davies in a KxCon talk a few years ago, you could use wrapper functions to make the code a bit easier to read:
q)trade:([]date:(.z.D-1),3#.z.D;sym:(3#`AA),`BB;price:1+til 4);
q)w:{(parse"select from t where ",x). 2 0}
q)?[trade;w"date=max date,price=(max;price)fby sym";0b;()]
date sym price
--------------------
2020.09.24 AA 3
2020.09.24 BB 4
This "w" won't cover all possible use-cases but it can be expanded to cover the more general cases.
I think your second parameter is getting cut off in your output. Notice how it ends with an ellipsis '..'. When you copy and paste it, you're only picking up part of the code.
,((=;date;(max;date));(=;`price;(k){$[(#x 1)=#y;#[(#y)#x[0]0#x 1;g;:;x[0]'x.. <- ellipsis here

In Emacs: how to reference latex equation in text by its number .dvi?

Suppose, I use Emacs to write a function in latex:
\begin{equation}
\label{eq:myeq}
x=2y
\end{equation}
that gives me
x = 2y (1)
in a resulting .dvi. And suppose I have dozens of such equations. Here is the problem: if I have to reference this equation but don't remember its name I want to be able to reference it by it's number ((1) in the shown case).
The story. Actually, I know there is an emacs package that has such a function. Like this: I press key combination, the function asks me to enter an equation number and returns it's name, nicely surrounded by (\ref{ and }). I used it, but after changing OS on my computer I've lost that Emacs installation. And now I don't remember what was the name of that package I once installed. Or maybe it was just a function in .emacs. Googling by key words gives RefTex, but I didn't found that feature in RefTex. So if someone uses that incredible package - please tell me its name!
Found the following package:
http://www.emacswiki.org/emacs/download/AuxLabel
Make sure to read the LIMITATIONS section.

Combine org mode capture and drill modules to learn vocabulary

I want to use the capture module of org-mode to create a data base of new words that I want to learn, and then use the drill module to learn them (flash cards style).
In my org-capture-templates I added the following:
("v" "Vocabulary" entry
(file+headline (concat org-directory "/vocab.org")
"Vocabulary")
"* Word :drill:\n%^ \n** Answer \n%^")
This is a rather naive template which I borrowed from here. It works fine but it is too limited. Unfortunately I'm rather new to elisp and I don't know how to improve it.
I think the above template has to be improved in the following there aspects:
Headline Currently the first input string is the (new) word and the headline is fixed. How can the headline be the same (input) word? I think that the following result is desirable:
* Vocabulary
** Foo :drill:
Foo
*** Answer
What is foo
Actually an even better way would be to have 3 input strings.
The new word (for example foo) which will be the headline.
If the second is empty, then it gets the same string as (1). Otherwise, concatenates the string to the one from (1). E.g. having as second input bar would yield foo bar. This will be the content of the entry.
The word's definition which should come in the answer sub-headline.
Duplications (see again this) If at some later point I try to capture foo again, I would like to know it, and be directed to edit the already existing entry - skipping all the inputs.
Sorting After capturing I think it would be nice to sort the list of words. This should not be too hard given that the headline of each entry is the word itself. In this case one can probably use the org-sort-entries function.
I know this is a rather big questions but I also think that if it can be solved here it will be of great use to many users.
Edits:
Using #juan_g suggestions, I improved my template and now it is:
("v" "Vocabulary" entry
(file+headline (concat org-directory "/vocab.org")
"Vocabulary")
"* %^{The word} :drill:\n %t\n %^{Extended word (may be empty)} \n** Answer \n%^{The definition}")
I didn't manage to set the default value of the second input to be the 1st one. I tried something like %^{Extended word (may be empty)|%\1} but it returns ^A which is not helpful.
In any case, this improved version seems to be already usable.
About the input question, in Org Mode Manual: 9.1.3.2 Template expansion, there is the %\1 special escape code:
%\n Insert the text entered at the nth %^{prompt}, where n a number, starting from 1.
The duplications question probably would need some Emacs Lisp coding.
For sorting, see C-c ^ (org-sort).
BTW, org-drill seems indeed a really interesting package, based on SuperMemo's spaced repetition algorithms.
You need an extra "\", therefore %\\1 works as expected.

Postgresql full text search part of words

Is postresql capable of doing a full text search, based on 'half' a word?
For example I'm trying to seach for "tree", but I tell postgres to search for "tr".
I can't find such a solution that is capable of doing this.
Currently I'm using
select * from test, to_tsquery('tree') as q where vectors ## q ;
But I'd like to do something like this:
select * from test, to_tsquery('tr%') as q where vectors ## q ;
You can use tsearch prefix matching, see http://www.postgresql.org/docs/9.0/interactive/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES
postgres=# select to_tsvector('tree') ## to_tsquery('tr:*');
?column?
----------
t
(1 row)
It will only work for prefix search though, not if you want partial match at any position in the word.
Sounds like you simply want wildcard matching.
One option, as previously mentioned is trigrams. My (very) limited experience with it was that it was too slow on massive tables for my liking (some cases slower than a LIKE). As I said, my experience with trigrams is limited, so I might have just been using it wrong.
A second option you could use is the wildspeed module: http://www.sai.msu.su/~megera/wiki/wildspeed
(you'll have to build & install this tho).
The 2nd option will work for suffix/middle matching as well. Which may or may not be more than you're looking for.
There are a couple of caveats (like size of the index), so read through that page thoroughly.
select * from test, to_tsquery('tree') as q
where vectors ## q OR xxxx LIKE ('%tree%')
':*' is to specify prefix matching.
It can be done with trigrams but it's not part of tsearch2.
You can view the manual here: http://www.postgresql.org/docs/9.0/interactive/pgtrgm.html
Basically what the pg_tgrm module does is split a word in all it's parts so it can search for those separate parts.