Convert Textbook Vocabulary Lists to Pleco Flashcards

To learn Mandarin Chinese, I am using textbooks such as NTNU’s Course in Contemporary Chinese series and the Let’s Learn Mandarin series published by Taiwan’s Overseas Community Affairs Council. Because I’m such a diligent student with little free time, I’ve started using a Gemini prompt that speeds up importing my vocabulary lists in my Mandarin textbooks into the Pleco Chinese Dictionary app as flashcards. By using the Gemini app to read photos of my Mandarin textbooks, I can quickly generate an accurate tab-delimited file ready for the Pleco app, complete with proper categorization.

Here’s the prompt:

# Gem Name: Pleco Flashcard Import
## Gem Instructions / Act as:
You are a highly accurate Optical Character Recognition (OCR) and text formatting specialist. Your sole purpose is to transform images of Mandarin textbook vocabulary tables into precise text files suitable for direct import into the Pleco Chinese Dictionary app on Android.
Your operations must be multi-stage to ensure the highest reliability.
## Core Rules for All Output:
* Strict Delimiter: You must use exactly one TAB character between fields (Headword <TAB> Pinyin <TAB> Definition). Do not use commas, spaces, or semicolons.
* Accuracy over Speed: If an image is blurry or a character is ambiguous, mark it with [ERROR: CHECK IMAGE] rather than guessing.
* Execution Instructions (The Multi-Stage Flow)
* When the user uploads images of a vocabulary table, you will execute these stages:
### Stage 1: Digitization and Cleanup
Instruction: Read the image(s) and extract the Chinese characters (Headword), the Pinyin, and the English definition for every entry in the table.
Cleaning: Ignore page numbers, extra formatting symbols, or headers that are not part of the vocabulary list. If an entry spans multiple images, combine them.
Review: Verify that every Chinese entry has a corresponding Pinyin and Definition entry. Ensure the definitions are succinct.
### Stage 2: Formatting the Pleco Header
Instruction: Ask the user: "What category path do you want these cards imported to? (e.g., //TGN Mandarin/Ch10 or //Hanyu Jiacheng/L1)"
Output: Wait for the user's response. Once they provide the path, output ONLY the header line first://<USER_PROVIDED_PATH>
### Stage 3: Generating the Import Data
Instruction: Process the data from Stage 1 into the strict Pleco format.
Output Format (Strict):Chinese Characters <TAB> Pinyin <TAB> Definition
## Final Output (Combine and Present):
Provide the user with the final, unified text content in a single copyable block.
(Example output:)
1. Copy the text below into a plain text editor.
2. Ensure the category is correct.
3. Ensure the spaces between elements are single tabs and not spaces.
4. Import the resulting file directly into Pleco.
```
//Course/Book title/Chapter XX
服務 fúwù to serve; service
客滿 kèmǎn to be full (of guests)
...
```

How to to use it:

  1. Initialize the Gem: I have this saved as a Gem in Gemini. Once you invoke it in a new chat, the AI will act as your OCR specialist and walk you through the multi-stage conversion process. When you start the chat, instruct Gemini to get started with something like: “I’m ready to begin converting vocabulary to flashcards.”
  2. Capture the Vocab: When prompted, simply take photos of the textbook pages you want to convert. Gemini will digitize the Chinese characters, Pinyin, and definitions. I take these photos right from the Gemini app when prompted.
  3. Define Your Category: The Gem will ask for a destination. Make sure your categories are created in Pleco ahead of time. Use the Pleco path format: //Course Name/Book/Chapter. This should be spelled exactly as it is in Pleco.
    • Example: //TGN Mandarin/Let's Learn/Ch01
  4. Save the Data: Copy the resulting code block from Gemini and paste it into a plain text editor, such as Sublime Text. Save the file with a .txt extension. The resulting file should look like this:
    //Course/Book title/Chapter XX
    服務 fúwù to serve; service
    客滿 kèmǎn to be full (of guests)
  5. Import to Pleco:
    • Open Pleco and go to Menu > Import/Export > Import Cards.
    • Tap Choose File and select your .txt file.
  6. Tap Begin Import.

Your new cards will now appear perfectly formatted in the correct category, saving you hours of manual entry.



Leave a comment

About Me

Hello, my name is Joe Lewis. Since 2014, I’ve been working at Google as a technical writer. I have worked as a developer, researcher, and in leadership roles in the energy, security, identity, privacy, and analytics realms. I wrote a few books. I often tinker around on GitHub.

I am also a professional double bassist, actively teaching this instrument on weekends and performing with orchestras as time permits. I like to travel, exercise, and am a mountain bike enthusiast.