Skip to content
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

Plan & Implement Cloze syntax. #43

Closed
alanxoc3 opened this issue Aug 16, 2020 · 5 comments
Closed

Plan & Implement Cloze syntax. #43

alanxoc3 opened this issue Aug 16, 2020 · 5 comments

Comments

@alanxoc3
Copy link
Owner

Anki has a cloze syntax. I was just using underscores, but there is no official one.

Same with newlines. Right now that is not supported.

@alanxoc3
Copy link
Owner Author

alanxoc3 commented Oct 8, 2020

:> {:我}\:喜{:欢}你 : I like you <:
   {}\:喜{}你 | 我, 喜
   我喜欢你 | I like you
   I like you | 我\:喜欢你

:> {我喜|欢|你|的狗} : I {like} your dog <:
   {}欢你的狗 | 我喜
   我喜{}你的狗 | 欢
   我喜欢{}的狗 | 你
   我喜欢你{} | 的狗
   我喜欢你的狗 | I like your dog
   I like your dog | 我喜欢你的狗
   I {} your dog | like

:> {:我喜|欢}你{的:狗} <:
   {}欢你的{} | 我喜, 狗
   我喜{}你的狗 | 欢
   我喜欢你{}狗 | 的

:> {:{我|喜}|欢}你{:的|狗} <:
   {}喜欢你{}狗 | 我, 的
   我{}欢你{}狗 | 喜, 的
   我喜{}你的狗 | 欢
   我喜欢你的{} | 狗

:> 你好
 : hello
 | A greeting
<:

Those are examples of what the cloze syntax will probably look like. Notice how I'm thinking about replacing the @> syntax with :> too.

@alanxoc3 alanxoc3 changed the title Consider cloze syntax and other formatting syntax. Plan cloze syntax. Oct 10, 2020
@alanxoc3 alanxoc3 changed the title Plan cloze syntax. Plan & Implement Cloze syntax. Oct 10, 2020
@alanxoc3
Copy link
Owner Author

I like the plan in the previous comment, so that is what I'll implement.

@alanxoc3
Copy link
Owner Author

Nevermind, I have a slightly different idea for cloze syntax:

This flashcard:
:> {郎才|女貌}
:: Smart {boys} get pretty {girls}.
 | Smart men get beautiful women.
<:

Becomes these flashcards:
:> {}女貌 | 郎才
:> 郎才{} | 女貌
:> Smart {} get pretty girls. | boys
:> Smart boys get pretty {}. | girls
:> 郎才女貌 | Smart boys get pretty girls. | Smart men get beautiful women.
:> Smart boys get pretty girls. | 郎才女貌
:> Smart men get beatiful women. | 郎才女貌
<:

Here is a different example that shows blanks going together with multiple
brackets:

:> Turning {{{{notes}}}} into {{flashcards}}, or should I say {{{concards}}}!
   {{{Concards}}} is my {ongoing | attempt | to} make {{flashcards}} simple and
   easily embeddable into {text} document {based} {{{{notes}}}}.
<:

Becomes:
:> Turning {} into flashcards, or should I say concards! Concards is my ongoing
   attempt to make flashcards simple and easily embeddable into text document
   based {}.
 | notes, notes
:> Turning notes into {}, or should I say concards! Concards is my ongoing
   attempt to make {} simple and easily embeddable into text document based notes.
 | flashcards, flashcards
:> Turning notes into flashcards, or should I say {}! {} is my ongoing attempt
   to make flashcards simple and easily embeddable into text document based notes.
 | concards, Concards
:> Turning notes into flashcards, or should I say concards! Concards is my {}
   attempt to make flashcards simple and easily embeddable into text document
   based notes.
 | ongoing
:> Turning notes into flashcards, or should I say concards! Concards is my
   ongoing {} to make flashcards simple and easily embeddable into text document
   based notes.
 | attempt
:> Turning notes into flashcards, or should I say concards! Concards is my
   ongoing attempt {} make flashcards simple and easily embeddable into text
   document based notes.
 | to
:> Turning notes into flashcards, or should I say concards! Concards is my
   ongoing attempt to make flashcards simple and easily embeddable into {}
   document based notes.
 | text
:> Turning notes into flashcards, or should I say concards! Concards is my
   ongoing attempt to make flashcards simple and easily embeddable into text
   document {} notes.
 | based
<:

@alanxoc3
Copy link
Owner Author

That comment also shows that I want to get rid of the : colon syntax and replace it with ::. The reasoning is because there would be less conflicts that way and it looks nicer (colon is a pretty common character).

@alanxoc3
Copy link
Owner Author

alanxoc3 commented Oct 18, 2020

Ok, I have yet another iteration of the cloze syntax. This also tries to replace the @> or :> with #::#

This flashcard:
#: {郎才:女貌}
:: Smart {boys} get pretty {girls}.
 | Smart men get beautiful women.
:#

Becomes these flashcards:
#: {}女貌 | 郎才
#: 郎才{} | 女貌
#: Smart {} get pretty girls. | boys
#: Smart boys get pretty {}. | girls
#: 郎才女貌 | Smart boys get pretty girls. | Smart men get beautiful women.
#: Smart boys get pretty girls. | 郎才女貌
#: Smart men get beatiful women. | 郎才女貌
:#

Here is a different example that shows blanks going together with multiple
brackets:

#: Turning ###{notes} into #{flashcards}, or should I say ##{concards}!
   ##{Concards} is my {ongoing. attempt. to} make #{flashcards} simple and
   easily embeddable into {text} document {based} ###{notes}.
:#

Becomes:
#: Turning {} into flashcards, or should I say concards! Concards is my ongoing
   attempt to make flashcards simple and easily embeddable into text document
   based {}.
 | notes, notes
#: Turning notes into {}, or should I say concards! Concards is my ongoing
   attempt to make {} simple and easily embeddable into text document based notes.
 | flashcards, flashcards
#: Turning notes into flashcards, or should I say {}! {} is my ongoing attempt
   to make flashcards simple and easily embeddable into text document based notes.
 | concards, Concards
#: Turning notes into flashcards, or should I say concards! Concards is my {}
   attempt to make flashcards simple and easily embeddable into text document
   based notes.
 | ongoing
#: Turning notes into flashcards, or should I say concards! Concards is my
   ongoing {} to make flashcards simple and easily embeddable into text document
   based notes.
 | attempt
#: Turning notes into flashcards, or should I say concards! Concards is my
   ongoing attempt {} make flashcards simple and easily embeddable into text
   document based notes.
 | to
#: Turning notes into flashcards, or should I say concards! Concards is my
   ongoing attempt to make flashcards simple and easily embeddable into {}
   document based notes.
 | text
#: Turning notes into flashcards, or should I say concards! Concards is my
   ongoing attempt to make flashcards simple and easily embeddable into text
   document {} notes.
 | based
:#

alanxoc3 added a commit that referenced this issue Oct 21, 2020
Next, I need to actually make a cloze work.
alanxoc3 added a commit that referenced this issue Oct 21, 2020
Need to finish implementing the logic now.
alanxoc3 added a commit that referenced this issue Oct 21, 2020
alanxoc3 added a commit that referenced this issue Oct 23, 2020
Cloze now passes the vital tests. There are still some edge case tests
that don't pass, so I need to work on that. The ones that don't pass
revolve around distributing spaces and groupings.
alanxoc3 added a commit that referenced this issue Oct 23, 2020
Cloze and complex logic around spaces pass all the tests. Only one test
fails now, and that is for cloze groups.
alanxoc3 added a commit that referenced this issue Oct 23, 2020
Next is time to write more edge cases. There are probably some that
are off.
alanxoc3 added a commit that referenced this issue Oct 23, 2020
I slightly modified what should be expected for the spacing tests to be
better. This means that a few hours of work has been made obsolete from
Wednesday. I also finished making cloze groups work as well as handling
edge cloze group space cases.
alanxoc3 added a commit that referenced this issue Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant