You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-1Lines changed: 33 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,3 @@
1
-
2
1
# Flashcard Generator Core
3
2
4
3
This project is the `flashcard-generator-core` library that uses the GPT API to create basic sentences using provided words in different languages.
@@ -12,6 +11,12 @@ The library supports various languages and can export the generated sentences to
12
11
- Configuration for language-specific features via a JSON file.
13
12
- Export generated flashcards to multiple file formats (CSV, JSON).
14
13
- Easily extendable to support more languages.
14
+
- Strict formatting rules for consistent and high-quality flashcards:
15
+
- Automatic "to" prefix for infinitive verbs in both languages
16
+
- Consistent capitalization (lowercase for vocabulary, proper sentence case for examples)
17
+
- Proper sentence punctuation
18
+
- Prevention of target word appearance in native language sentences
19
+
- Support for generating multiple varied flashcards for the same word
15
20
16
21
## Requirements
17
22
- Java 22 or higher
@@ -76,6 +81,33 @@ This flexibility allows developers to create applications that fit their specifi
76
81
77
82
1.**GPT Implementation** (`FlashcardServiceGPTImpl.java`): Currently the only flashcard service available is using the OpenAI API. The service uses a `PromptService` to generate the appropriate prompts to the API, `HttpClientService` to generate the HTTP request and handle the HTTP response, and a `JsonParseService` to parse the response under the hood.
78
83
84
+
#### Flashcard Formatting Rules
85
+
86
+
The library enforces strict formatting rules to ensure consistency and quality in generated flashcards:
87
+
88
+
1.**Verb Handling**:
89
+
- Infinitive verbs are automatically prefixed with "to " in both native and target languages
90
+
- Example: "to run" / "to speak" / "to write"
91
+
92
+
2.**Case Consistency**:
93
+
- Vocabulary words (both native and target) are always in lowercase
94
+
- Example sentences follow proper capitalization rules (start with capital letter)
95
+
96
+
3.**Sentence Structure**:
97
+
- All example sentences must end with a period
98
+
- Proper sentence structure and punctuation are enforced
99
+
100
+
4.**Word Usage in Sentences**:
101
+
- For sentence-based flashcards, the target word NEVER appears in the native language sentence
102
+
- Instead, appropriate translations or alternative phrasings are used
103
+
- This ensures proper learning without direct word repetition
104
+
105
+
5.**Multiple Flashcard Generation**:
106
+
- When generating multiple flashcards for the same word, each flashcard:
107
+
- Uses exactly the same target word (no synonyms or related words)
108
+
- Provides different example sentences and contexts
109
+
- Maintains all formatting rules consistently
110
+
79
111
### Output Services
80
112
81
113
1.**CSV Mode** (`OutputServiceCsvMode.java`): Flashcards can be exported to a CSV file, where each flashcard is a separate line with fields separated by commas.
0 commit comments