module IndianLanguage.Marathi (
	makeMaraattheeSentence, makeMaraattheeFile  
  ) where

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

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


--converting from marathi sentence(s) file in english font to marathi font 
makeMaraattheeFile :: FilePath -> FilePath -> IO()
makeMaraattheeFile "" "" = putStrLn ""
makeMaraattheeFile 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