packages feed

indian-language-font-converter 0.0 → 0.1

raw patch · 7 files changed

+48/−84 lines, 7 files

Files

+ IndianLanguage/Font.hs view
@@ -0,0 +1,36 @@+module IndianLanguage.Font (+	convertToStr, convertToFile  +  ) where++import Graphics.UI.Gtk+import Data.Char+import IndianLanguage.HandleTranslation++--converting from marathi sentence in english font to marathi font +convertToStr :: String -> String -> IO()+convertToStr lang "" = putStrLn ""+convertToStr lang str = if(checkValid lang) then (if(lang == "hindi") then (makeWindow "marathi" (checkForSymbols (map toLower str))) else (makeWindow lang (checkForSymbols (map toLower str)))) else putStrLn "first argument should always be from the list : \n[\"hindi\",\"marathi\",\"kannada\",\"gujarati\",\"bengali\",\"punjabi\",\"telugu\",\"malayalam\",\"oriya\"]"++--checking for validity of language+checkValid str = if(elem (map toLower str) ["hindi","marathi","kannada","gujarati","bengali","punjabi","telugu","malayalam","oriya"]) then True else False++convertToFile :: String -> FilePath -> FilePath -> IO()+convertToFile lang "" "" = putStrLn ""+convertToFile lang file1 file2 = if(checkValid lang) then (if(lang == "hindi") then (convertToFileTemp "marathi" file1 file2) else (convertToFileTemp lang file1 file2)) else putStrLn "first argument should always be from the list : \n[\"hindi\",\"marathi\",\"kannada\",\"gujarati\",\"bengali\",\"punjabi\",\"telugu\",\"malayalam\",\"oriya\"]"++--converting from any of the 9 Indian Language sentence(s) file in english font to Indian font (for marathi,hindi,kannada,gujarati,bengali,punjabi,telugu,malayalam,oriya) +convertToFileTemp :: String -> FilePath -> FilePath -> IO()+convertToFileTemp lang "" "" = putStrLn ""+convertToFileTemp lang file1 file2 = do+  initGUI	+  textField1 <- textViewNew+  textBuffer1 <- textViewGetBuffer textField1+  str <- readFile file1+  marathiFont (finalMarathi $ map toLower (checkForSymbols str)) "Languages.db" textBuffer1 (lang ++ "Fonts")+  sI <- textBufferGetStartIter textBuffer1                    +  eI <- textBufferGetEndIter textBuffer1+  text1 <- textBufferGetText textBuffer1 sI eI True+  let ch = filter (/='a') $ unwords $ putNL $ words (leaveIt text1)+  writeFile file2 ch+         +
IndianLanguage/HandleTranslation.hs view
@@ -17,8 +17,8 @@   --making a window to display the output text-makeWindow :: String -> IO()-makeWindow str = do+makeWindow :: String -> String -> IO()+makeWindow lang str = do   initGUI   window <- windowNew   @@ -32,9 +32,9 @@      containerAdd window scroll1     -  onlyOneLang textBuffer1 "marathiFonts" str+  onlyOneLang textBuffer1 (lang ++ "Fonts") str   -  set window [windowTitle := "Hindi Or Marathi Script Writer", containerBorderWidth := 10]+  set window [windowTitle := "Indian Language Script Writer", containerBorderWidth := 10]   windowSetGeometryHints window (Nothing :: Maybe Window)     (Just (500,100)) (Just (500,100)) Nothing Nothing Nothing   
− IndianLanguage/Hindi.hs
@@ -1,31 +0,0 @@-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-
− IndianLanguage/Marathi.hs
@@ -1,32 +0,0 @@-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--
Languages.db view

binary file changed (26624 → 173056 bytes)

README.txt view
@@ -21,18 +21,17 @@ ** Testing the package :  1) we have three modules : -		IndianLanguage.Marathi-		IndianLanguage.Hindi+		IndianLanguage.Font 		IndianLanguage.HandleTranslation -2) IndianLanguage.HandleTranslation is a supporting module for the remaining two modules. Our main aim is to use first two modules listed above.+2) IndianLanguage.HandleTranslation is a supporting module for the remaining two modules. Our main aim is to use first module listed above. -3) Prelude> :module IndianLanguage.Marathi -   Prelude IndianLanguage.Marathi> makeMaraattheeSentence "maaze naav Aakaash aahe" +3) Prelude> :module IndianLanguage.Font +   Prelude IndianLanguage.Font> convertToStr "marathi" "maaze naav Aakaash aahe"      It will generate a window having a textview with "माझे नाव आकाश आहे" in it.  -   Prelude IndianLanguage.Marathi> makeMaraattheeFile "inputFile.txt" "outputFile.txt"+   Prelude IndianLanguage.Font> convertToFile "marathi" "inputFile.txt" "outputFile.txt"     Here, inputFile.txt will have any number of sentences on marathi meaning but which are written in english alphabets, like : @@ -42,17 +41,10 @@    File Line No 4 : aaj guruvaar aahe.     File Line No 5 : shubh prabhaat.  -   And after calling "makeMaraattheeFile" function, our "outputFile.txt" will contain :+   And after calling "convertToFile" function, our "outputFile.txt" will contain :    File Line No 1 : माझे नाव आकाश आहे .    File Line No 2 : मी चिंचवड मध्ये राहतो .     File Line No 3 : आकाश माझा मित्र आहे .     File Line No 4 : आज गुरुवार आहे .     File Line No 5 : शुभ प्रभात .- 	-4) The same this is present for IndianLanguage.Hindi-   Two functions, almost similar to makeMaraattheeSentence and makeMaraattheeFile. They are :--   makeHindeeSentence-   makeHindeeFile- 
indian-language-font-converter.cabal view
@@ -4,7 +4,7 @@   Indian Language Font Converter description:   The package is made for people who want to get the sentences in Hindi or Marathi font so that they don't need to remember keys on keyboards when they type Hindi or Marathi script. Or they don't need to waste time on virtual keyboards where everything works with a mouse.-version: 0.0+version: 0.1 license: BSD3 license-file: LICENSE maintainer: Akash Fulchand Jagdhane@@ -15,6 +15,5 @@ library   build-depends: base >=3 && < 5, HDBC, HDBC-sqlite3, gtk   exposed-modules:-    IndianLanguage.Marathi-    IndianLanguage.Hindi+    IndianLanguage.Font     IndianLanguage.HandleTranslation