module IndianLanguage.Hindi (
	makeHindeeSentence, makeHindeeFile  
  ) where

import Graphics.UI.Gtk
--import Database.HDBC.Sqlite3 (connectSqlite3)
--import Database.HDBC
import Data.Char
import IndianLanguage.HandleTranslation

--converting from hindi sentence in english font to hindi font 
makeHindeeSentence :: String -> IO()
makeHindeeSentence "" = putStrLn ""
makeHindeeSentence str = makeWindow (checkForSymbols str)


--converting from hindi sentence(s) file in english font to hindi font 
makeHindeeFile :: FilePath -> FilePath -> IO()
makeHindeeFile "" "" = putStrLn ""
makeHindeeFile file1 file2 = do
	initGUI	
        textField1 <- textViewNew
  	textBuffer1 <- textViewGetBuffer textField1
	str <- readFile file1
	marathiFont (finalMarathi $ map toLower (checkForSymbols str)) "Languages.db" textBuffer1 "marathiFonts"
     	sI <- textBufferGetStartIter textBuffer1                    
     	eI <- textBufferGetEndIter textBuffer1
     	text1 <- textBufferGetText textBuffer1 sI eI True
     	let ch = filter (/='a') $ unwords $ putNL $ words (leaveIt text1)
	writeFile file2 ch