Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/arverma/Bihar-Police-Notebook/llms.txt

Use this file to discover all available pages before exploring further.

Bihar Police Notebook includes a built-in Hinglish transliteration engine so you can type in the familiar Roman script and see Devanagari suggestions appear as you write. Pressing Space accepts the best suggestion instantly — no separate IME or keyboard layout required.

The Hindi Typing Toggle

The A:अ toggle in the editor header switches transliteration on and off. Its state is remembered in localStorage under the key langMode.
Each word you type is sent to the Google Input Tools API as you pause between characters. Up to five Devanagari suggestions appear in a floating popup anchored below the current word.
  • Press Space to accept the top suggestion and move to the next word.
  • Click any suggestion in the popup to insert that specific alternative.
  • Suggestions are cached in memory for the lifetime of the page — re-typing the same Hinglish word never makes a second network request.

How Suggestions Are Fetched

The app calls the Google Input Tools endpoint with the current word and itc=hi-t-i0-und to request Hindi transliteration:
GET https://inputtools.google.com/request
  ?text=<word>
  &itc=hi-t-i0-und
  &num=5
  &cp=0
  &cs=1
  &ie=utf-8
  &oe=utf-8
The response follows this shape:
["SUCCESS", [["<input>", ["सुझाव1", "सुझाव2", "सुझाव3"], [], {}]]]
The app extracts up to five candidates from data[1][0][1] and stores them in a plain object cache keyed by the Hinglish word. Subsequent lookups for the same word are served from cache without any network activity.

Words That Are Never Transliterated

The shouldSkipTransliteration() function checks each word before making an API call and skips it silently in two cases:
ConditionExampleBehaviour
Pure number (digits, ., ,, -, /)164, 2024-06-15, 420/IPCKept as typed — no request
Contains any uppercase Latin letter (A–Z)IPC, FIR, Section, CrPCKept as typed — no request
This means legal citations and section references stay in their standard English / acronym form without any extra steps on your part.
// From editor/js/translit.js
const PURE_NUMBER_RE = /^[\d.,\-\/]+$/;
const HAS_LATIN_UPPER_RE = /[A-Z]/;

export function shouldSkipTransliteration(word) {
    const key = String(word ?? '').trim();
    if (!key) return true;
    if (PURE_NUMBER_RE.test(key)) return true;
    if (HAS_LATIN_UPPER_RE.test(key)) return true;
    return false;
}

Mobile Devices

On screens 768 px wide or narrower the toggle button is hidden entirely. The internal check isTransliterationEnabled() returns false whenever the (max-width: 768px) media query matches — no suggestions are requested and no popup is shown.
// From editor/js/main.js
const mobileInputMq = window.matchMedia('(max-width: 768px)');

function isTransliterationEnabled() {
    return !isHindiMode && !mobileInputMq.matches;
}
On a phone, use your device keyboard’s built-in Hindi input or its microphone key instead.
The transliteration feature requires an active internet connection. If you are offline, turn the toggle OFF so you can continue typing without the app waiting for a network response that will never arrive.

Workflow Example

1

Turn the toggle ON

Click A:अ in the header. The editor placeholder updates to “यहाँ Hinglish में टाइप करें…”.
2

Type a Hinglish word

For example, type prarthna. After a brief 50 ms pause, a popup shows up to five Devanagari options such as प्रार्थना, प्रार्थन, etc.
3

Accept or choose

Press Space to accept the first suggestion (प्रार्थना) and move on, or click a different suggestion to insert it instead.
4

Type English acronyms as-is

Type IPC or FIR and press Space — because these contain uppercase letters, they are inserted verbatim with no transliteration.
If a suggestion popup appears for a word you want to keep in English, simply turn the toggle OFF for that paragraph, type the content, then turn it back ON.

Build docs developers (and LLMs) love