emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bob Newell <bobnewell@bobnewell.net>
To: emacs-orgmode@gnu.org
Subject: Re: org-drill vocabulary and question about properties
Date: Wed, 31 Jul 2019 17:09:37 -1000	[thread overview]
Message-ID: <871ry5inta.fsf@bobnewell.net> (raw)
In-Reply-To: <87r266xanj.fsf@zamazal.org> (Milan Zamazal's message of "Wed, 31 Jul 2019 21:32:32 +0200")

Milan Zamazal <pdm@zamazal.org> writes:

>     GB> still only once there. If I want to track the learning in both
>     GB> directions separately, I need to make two items for one word,
>     GB> once german-spanish and once spanish-german. Am I right?

I've used org-drill for both English/Hawaiian and English/Hindi, and
I've never been able to get balanced two-way drills without making
separate cards for each direction. But making card pairs is really easy
to automate.

I make a .org file with words in one direction only, semicolon separated
like this:

hindiword1;englishword1
hindiword2;englishword2

etc. etc. and then call the following elisp. (Obviously works for any
pair of languages.) The elisp sets up a two-way org drill file that does
what I want. The coding is crude and could be improved however it works,
which is something of a benefit :)

;; Make Hindi flashcards for org-drill
;; Pseudo-Two sided, English/Hindi
(defun org-make-hindi ()
 "Make Hindi flashcards"
 (interactive)
 (goto-char (point-min))
;; Process each line top to bottom.
 (while (not (eobp))
  (beginning-of-line)
  (setq frontofline (point))
  (search-forward ";") 
  (backward-delete-char 1)
  (setq partone (buffer-substring frontofline (point)))
  (delete-region frontofline (point))
  (setq frontofline (point))
  (end-of-line)
  (setq parttwo (buffer-substring frontofline (point)))
  (delete-region frontofline (point))
  (delete-char 1)
  (insert (concat "** Word :drill:\n:PROPERTIES:\n:END:\n"
          partone "\n*** A\n" parttwo "\n"
	  "** Word :drill:\n:PROPERTIES:\n:END:\n"
	  parttwo "\n" "*** A\n" partone "\n"))
 )
 )



-- 
Bob Newell
Honolulu, Hawai`i
* Via Gnus/BBDB/Org/Emacs/Linux *

      reply	other threads:[~2019-08-01  3:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29 14:56 org-drill vocabulary and question about properties Gerhard Butscher
     [not found] ` <WM!fa384f8b7f257507d091606088897a6d13f2e56e737227ef2e036a835b70c7579f2959b493bb262460d406db80a2e5d5!@mailhub-mx4.ncl.ac.uk>
2019-07-31 11:44   ` Phillip Lord
2019-07-31 19:32 ` Milan Zamazal
2019-08-01  3:09   ` Bob Newell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ry5inta.fsf@bobnewell.net \
    --to=bobnewell@bobnewell.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).