CoolFace
Apppublic

team-dialect-map/dialect-map

sourceHugging Facemitupdated 8mo agoView on Hugging Face
4likes
App README

Telugu Dialect Map

Interactive web-based visualization of Telugu dialect words across Telangana and Andhra Pradesh districts.

๐ŸŽฏ Features

  • โ€”48 Districts: 33 Telangana + 15 Andhra Pradesh districts
  • โ€”Dynamic Data Loading: Automatically loads data from JSON sources
  • โ€”Interactive Map: Click districts to explore local vocabulary, meanings, and sources
  • โ€”Rich Content: 3000+ verified dialect terms from crowdsourced and JSONL data
  • โ€”Zero Build Required: Pure static site with automatic data loading
  • โ€”Google Sheets Integration: Automated synchronization with Google Sheets

๐Ÿš€ Deployment Options

Option 1: Hugging Face Spaces (Recommended for Public Access)

Deploy to Hugging Face Spaces with continuous automation:

  1. 1.Create a Space on Hugging Face
  2. 2.Configure secrets for config.json and credentials.json
  3. 3.Push your code to the Space repository
  4. 4.Access your app at https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE

๐Ÿ“– [Complete HF Spaces Setup Guide โ†’](SECRETS_SETUP.md)

Option 2: Local Development

๐Ÿš€ How to Run

Complete Setup (First Time)

bash
# 1. Navigate to project directory
cd /home/kashikuldeep/Desktop/swechaworkspace/dilacet-map/indian-dialects-maps

# 2. Activate virtual environment
source venv/bin/activate

# 3. Start automation (syncs Google Sheets every 5 minutes)
python scripts/automation_runner.py &

# 4. Start web server (in new terminal or background)
python -m http.server 8080 &

# 5. Open in browser
# Navigate to: http://localhost:8080/

Quick Run (After First Time)

bash
# Activate virtual environment
source venv/bin/activate

# Start both services
python scripts/automation_runner.py &
python -m http.server 8080 &

# Open: http://localhost:8080/

Stop Services

bash
# Press Ctrl+C in the terminals, or:
pkill -f automation_runner
pkill -f "http.server 8080"

Important: Use http://localhost:8080/ not file:// URLs (browser security blocks JSON loading from file://)


๐ŸŽฏ What You'll See

  1. 1.Automation Console: Shows sync status every 5 minutes
  2. 2.Web Interface: Interactive map with 48 districts (33 Telangana + 15 Andhra Pradesh)
  3. 3.Auto-Updates: Edit Google Sheets โ†’ Changes appear within 5 minutes!

๐Ÿค– Automated Data Updates

The project includes automated synchronization from Google Sheets:

  • โ€”File Watcher: Automatically converts CSV โ†’ JSON when files change
  • โ€”Google Sheets Sync: Downloads sheet data every 5 minutes
  • โ€”Zero Manual Work: Update your Google Sheet and changes appear automatically!

Configuration

Your automation is already configured for:

  • โ€”Processed Dialects Sheet: 901 rows
  • โ€”Digiwords Sheet: 178 rows
  • โ€”Sync Interval: Every 5 minutes

To modify settings, edit config.json:

json
{
  "google_sheets": {
    "enabled": true,
    "sync_interval_minutes": 5,
    "spreadsheets": [...]
  }
}

๐Ÿ“– [Full Automation Setup Guide โ†’](AUTOMATION_SETUP.md)

๐Ÿ“‚ Project Structure

indian-dialects-maps/
โ”œโ”€โ”€ index.html                      # Main visualization (open this via http server)
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ processed/
โ”‚       โ”œโ”€โ”€ processed_dialects.json      # JSONL-processed dialect data
โ”‚       โ””โ”€โ”€ digiwords_grouped.json       # Crowdsourced dialect data
โ”œโ”€โ”€ sheets_output/                       # CSV files (auto-converted to JSON)
โ”‚   โ”œโ”€โ”€ processed_dialects.csv
โ”‚   โ””โ”€โ”€ digiwords_grouped.csv
โ”œโ”€โ”€ scripts/                             # Automation scripts (NEW!)
โ”‚   โ”œโ”€โ”€ csv_to_json.py                   # CSV โ†’ JSON converter
โ”‚   โ”œโ”€โ”€ sheets_sync.py                   # Google Sheets downloader
โ”‚   โ”œโ”€โ”€ file_watcher.py                  # Auto-conversion on file changes
โ”‚   โ””โ”€โ”€ automation_runner.py             # Main automation orchestrator
โ”œโ”€โ”€ config.json                          # Automation configuration
โ”œโ”€โ”€ requirements.txt                     # Python dependencies
โ”œโ”€โ”€ AUTOMATION_SETUP.md                  # Detailed setup guide
โ””โ”€โ”€ README.md

๐Ÿ”„ How It Works

Manual Mode (Original)

  1. 1.Load `index.html`: Contains hardcoded data for 33 Telangana districts
  2. 2.Fetch `processed_dialects.json`: Enhances/adds districts from JSONL data
  3. 3.Fetch `digiwords_grouped.json`:
  4. 4.Merges additional words into Telangana districts
  5. 5.Automatically adds 15 Andhra Pradesh districts with coordinates
  6. 6.Render: All districts appear on the map with merged data

Automated Mode (NEW!)

  1. 1.Google Sheets: Update your dialect data in Google Sheets
  2. 2.Auto-Sync: Script downloads sheets as CSV (every 5 min)
  3. 3.File Watcher: Detects CSV changes
  4. 4.Auto-Convert: CSV files โ†’ JSON format
  5. 5.Browser: Refresh to see updates on the map!

Flow:

Google Sheet โ†’ CSV (sheets_output/) โ†’ JSON (data/processed/) โ†’ Browser (index.html)
     โ†“              โ†“                      โ†“
  Manual Edit   File Watcher         Auto-Refresh

Smart Merging:

  • โ€”Existing districts โ†’ Appends new words
  • โ€”New AP districts โ†’ Creates markers automatically
  • โ€”Graceful fallback if JSON files are missing

๐Ÿ“Š Current Data Coverage

StateDistrictsWordsSources
Telangana332000+Hardcoded + JSONL + Digiwords
Andhra Pradesh151000+Digiwords (crowdsourced)
Total483000+Multiple sources

Andhra Pradesh Districts:

Anantapur, Annamayya, Chittoor, East Godavari, Eluru, Kadapa, Kurnool, Nandyal, Ongole, Tirupati, Srikakulam, Visakhapatnam, Vizianagaram, West Godavari, Rayalaseema

๐ŸŽจ Adding New Data

Update Existing JSON Files

Edit `data/processed/digiwords_grouped.json`:

json
{
  "Telangana": {
    "YourDistrict": [
      {"t": "เฐคเฑ†เฐฒเฑเฐ—เฑเฐชเฐฆเฐ‚", "m": "meaning", "s": "Crowd"}
    ]
  },
  "Andhra Pradesh": {
    "YourDistrict": [
      {"t": "เฐคเฑ†เฐฒเฑเฐ—เฑเฐชเฐฆเฐ‚", "m": "meaning", "s": "Crowd"}
    ]
  }
}

Edit `data/processed/processed_dialects.json`:

json
[
  {
    "name": "YourDistrict",
    "region": "Region Name",
    "words": [
      {"t": "เฐคเฑ†เฐฒเฑเฐ—เฑเฐชเฐฆเฐ‚", "m": "meaning", "s": "Source"}
    ]
  }
]

Then refresh the browser!

Add New AP District Coordinates

If adding a new Andhra Pradesh district, update index.html:

javascript
const AP_COORDINATES = {
    "YourDistrict": { 
        lat: 00.0000, 
        lng: 00.0000, 
        region: "Region Name", 
        history: "Historical context..." 
    },
    // ...
};

๐Ÿ› ๏ธ Technical Stack

  • โ€”Frontend: HTML5, Vanilla JavaScript, Leaflet.js
  • โ€”Data Format: JSON (pre-processed)
  • โ€”Map Library: Leaflet with CartoDB basemap
  • โ€”Server: Any HTTP server (Python, Node, etc.)
  • โ€”No Build Step: Pure static site

๐Ÿ› Troubleshooting

Data Not Loading?

โœ… Check #1: Are you using http://localhost:8000/?

  • โ€”โŒ Don't use file:// URLs
  • โ€”โœ… Use an HTTP server

โœ… Check #2: Is the server running?

bash
python3 -m http.server 8000

โœ… Check #3: Hard refresh the page

  • โ€”Press Ctrl + Shift + R (Windows/Linux)
  • โ€”Press Cmd + Shift + R (Mac)

โœ… Check #4: Check browser console (F12)

  • โ€”Look for fetch errors
  • โ€”Should see loading messages

Server Won't Start?

bash
# Kill process on port 8000
lsof -ti:8000 | xargs kill -9

# Start fresh
python3 -m http.server 8000

Still Not Working?

  1. 1.Open browser console (F12)
  2. 2.Look for error messages
  3. 3.Check that JSON files exist in data/processed/
  4. 4.Verify you're on the correct URL (localhost:8000 not 127.0.0.1 if redirects are weird)

๐Ÿ“ Technical Notes

  • โ€”Telugu text uses web fonts (Poppins, Ramabhadra)
  • โ€”Console shows detailed merge logs for debugging
  • โ€”Map centered at (16.5ยฐN, 79.8ยฐE) to show both states
  • โ€”Zoom level: 6.5 (fits both Telangana and AP)
  • โ€”Data loads asynchronously with async/await

๐Ÿค Contributing

To add more dialect data:

  1. 1.Edit the JSON files in data/processed/
  2. 2.Refresh http://localhost:8000/
  3. 3.That's it!

Made with โค๏ธ for preserving Telugu linguistic heritage across Telangana and Andhra Pradesh