Assaf Solomovitch Tsahi Talmor


Phoneme::ITranslatable Interface Reference



Download 266.03 Kb.
Page6/6
Date30.04.2017
Size266.03 Kb.
#16751
1   2   3   4   5   6

Phoneme::ITranslatable Interface Reference


Interface of any class who wants phonemic translation from latin chars to any other language's unicode chars.

Inherited by Phoneme::HebrewTranslator.



Public Member Functions


  • String translate (String origin, IPhoneticTranslatorUserInteraction handler)

translate unicode strings from latin chars to any language unicode chars handler used when translation ambiguities needs resolve by user

Detailed Description


Interface of any class who wants phonemic translation from latin chars to any other language's unicode chars.

Member Function Documentation

String Phoneme::ITranslatable::translate (String origin, IPhoneticTranslatorUserInteraction handler)


translate unicode strings from latin chars to any language unicode chars handler used when translation ambiguities needs resolve by user
Parameters:

origin Latin string to translate

handler Handler to Interface used to resolve translation ambiguities by UI
Returns:

Translated string in unicode chars of any language
The documentation for this interface was generated from the following file:

  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/ITranslatable.cs

Phoneme::LowLevelKeyboardHook Class Reference


Class represents a Windows keyboard hook, WH_KEYBOARD_LL, which intercepts all keyboard presses and filters them through our filter function, and them lets them proceed to their target application.

Public Member Functions


  • void Dispose ()

Ascertain disabling the hook.

  • LowLevelKeyboardHook (AppProfile currentProfile)

Constructor: initialise the horKeylist from outside.

  • void InstallHook ()

Install a WH_KEYBOARD_LL global hook in the system, with filter function HookCallback and a module handle. Installation can be done only once, and function enforces this (we cannot and shouldn't install several of the same hook).

  • void UninstallHook ()

Uninstallation of previuoslty installed hook.

Public Attributes


  • List< Keys > m_hotKeyList

list of hotkeys which activate our functionality

Static Public Attributes


  • static bool AllHooksStatus = true

mutex to ensure no duality of processing the hook

Classes


  • class KeboardHookEventArgs

Arguments of keyboard hooks.

Detailed Description


Class represents a Windows keyboard hook, WH_KEYBOARD_LL, which intercepts all keyboard presses and filters them through our filter function, and them lets them proceed to their target application.

Constructor & Destructor Documentation

Phoneme::LowLevelKeyboardHook::LowLevelKeyboardHook (AppProfile currentProfile) [inline]


Constructor: initialise the horKeylist from outside.
Parameters:

currentProfile Application profile which holds the relevant hotkeyList

Member Function Documentation

void Phoneme::LowLevelKeyboardHook::Dispose () [inline]


Ascertain disabling the hook.

void Phoneme::LowLevelKeyboardHook::InstallHook () [inline]


Install a WH_KEYBOARD_LL global hook in the system, with filter function HookCallback and a module handle. Installation can be done only once, and function enforces this (we cannot and shouldn't install several of the same hook).

void Phoneme::LowLevelKeyboardHook::UninstallHook () [inline]


Uninstallation of previuoslty installed hook.

Member Data Documentation

List Phoneme::LowLevelKeyboardHook::m_hotKeyList


list of hotkeys which activate our functionality

bool Phoneme::LowLevelKeyboardHook::AllHooksStatus = true [static]


mutex to ensure no duality of processing the hook
The documentation for this class was generated from the following file:

  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/LowLevelKeyboardHook.cs

Phoneme::LowLevelKeyboardHook::KeboardHookEventArgs Class Reference


Arguments of keyboard hooks.

Detailed Description


Arguments of keyboard hooks.
The documentation for this class was generated from the following file:

  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/LowLevelKeyboardHook.cs



Phoneme::Phoneme Class Reference


The phoneme project http://t2.technion.ac.il/~solicko.

Inherits Phoneme::IPhoneticTranslatorUserInteraction.



Public Member Functions


  • Phoneme ()

Constructor: Initialize Low Level hook and the phonetic translator.

  • string doUI (List< System.Text.StringBuilder > possibleTranslations, String currentWord)

Function displays to user all possibilities in listbox1, and forces him to decide on the correct choice, and than returns its string representation.

Public Attributes


  • AppProfile m_currentProfile = new AppProfile()

Current application profile.

Static Public Attributes


  • static IntPtr m_appWindow = new IntPtr(0)

hwnd of window that activated phoneme with a hotkey

  • static IntPtr m_phonemeAppWindow = new IntPtr(0)

hwnd of Phoneme application

  • static bool didUserSolve = false

mutex to wait for event of doubleClick in listBox1 - wait for user to determine correct translation

Protected Member Functions


  • override void Dispose (bool disposing)

Clean up any resources being used.

Detailed Description


The phoneme project http://t2.technion.ac.il/~solicko.

Constructor & Destructor Documentation

Phoneme::Phoneme::Phoneme () [inline]


Constructor: Initialize Low Level hook and the phonetic translator.

Member Function Documentation

string Phoneme::Phoneme::doUI (List< System.Text.StringBuilder > possibleTranslations, String currentWord) [inline]


Function displays to user all possibilities in listbox1, and forces him to decide on the correct choice, and than returns its string representation.
Parameters:

possibleTranslations List of feasible possibilites from which the user should choose and decide

currentWord The ambiguous Latin string
Returns:

The user's decision

override void Phoneme::Phoneme::Dispose (bool disposing) [inline, protected]


Clean up any resources being used.
Parameters:

disposing true if managed resources should be disposed; otherwise, false.

Member Data Documentation

IntPtr Phoneme::Phoneme::m_appWindow = new IntPtr(0) [static]


hwnd of window that activated phoneme with a hotkey

IntPtr Phoneme::Phoneme::m_phonemeAppWindow = new IntPtr(0) [static]


hwnd of Phoneme application

AppProfile Phoneme::Phoneme::m_currentProfile = new AppProfile()


Current application profile.

bool Phoneme::Phoneme::didUserSolve = false [static]


mutex to wait for event of doubleClick in listBox1 - wait for user to determine correct translation
The documentation for this class was generated from the following files:

  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/Phoneme.cs

  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/Phoneme.Designer.cs

Phoneme::PhoneticTranslator Class Reference


Main class of Phoneme, responsible of actual translation, regardless to language or translation heuristics.

Public Types


  • enum SUPPORTEDLANGUAGES

All supported language by phoneme.

Public Member Functions


  • PhoneticTranslator ()

Default constructor: assume translation to Hebrew.

  • PhoneticTranslator (String language)

Constructor which sets the translation language.

  • bool isHebrew ()

return true iff translatino language is Hebrew

  • bool isRussian ()

return true iff translatino language is Russian

  • String Translate (String origin, IPhoneticTranslatorUserInteraction IformHandler)

Functionality of translator is encompassed in this function - takes a unicode Latin chars based sentence, parses it to words, and translates each word.

  • void setLanguage (String lan)

Sets translator language.

Public Attributes


  • StringTrie m_trie = null

The data structure to hold wordlist.

  • ITranslatable m_myTranslator

Actual translator of any language.

Detailed Description


main class of Phoenme, responsible of

Member Enumeration Documentation

enum Phoneme::PhoneticTranslator::SUPPORTEDLANGUAGES


All supported language by phoneme.

Constructor & Destructor Documentation

Phoneme::PhoneticTranslator::PhoneticTranslator () [inline]


Default constructor: assume translation to Hebrew.

Phoneme::PhoneticTranslator::PhoneticTranslator (String language) [inline]


Constructor which sets the translation language.
Parameters:

language String representation of the language(i.e. "HEBREW")

Member Function Documentation

bool Phoneme::PhoneticTranslator::isHebrew () [inline]


return true iff translatino language is Hebrew
Returns:

return true iff translatino language is Hebrew

bool Phoneme::PhoneticTranslator::isRussian () [inline]


return true iff translatino language is Russian
Returns:

return true iff translatino language is Russian

String Phoneme::PhoneticTranslator::Translate (String origin, IPhoneticTranslatorUserInteraction IformHandler) [inline]


Functionality of translator is encompassed in this function - takes a unicode Latin chars based sentence, parses it to words, and translates each word.
Parameters:

origin Sentence to translate

IformHandler points to interface to use when translation ambiguity needs to be resolved by user
Returns:

Returns unicode based translation in chosen translate to language.

void Phoneme::PhoneticTranslator::setLanguage (String lan) [inline]


Sets tranlstor language.
Parameters:

lan String representation of language(upper or lowecase or both)

Member Data Documentation

StringTrie Phoneme::PhoneticTranslator::m_trie = null


The data structure to hold wordlist.

ITranslatable Phoneme::PhoneticTranslator::m_myTranslator


Actual translator of any language.
The documentation for this class was generated from the following file:

  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/PhoneticTranslator.cs

Phoneme::predefinedTranslations Class Reference


Class of brute-force translations. Holds datastructure which maps translations String->String. Can be dynamically changed, so Phoneme can study the user's brute- force transaltions and save them for future use (TBD).

Public Member Functions


  • predefinedTranslations ()

Constructor:.

  • String translate (String str)

Gets key to dictionary, seeks it in dictionary, and returns it's mapping.

Detailed Description


Class of brute-force translations. Holds datastructure which maps translations String->String. Can be dynamically changed, so Phoneme can study the user's brute- force transaltions and save them for future use (TBD).

Constructor & Destructor Documentation

Phoneme::predefinedTranslations::predefinedTranslations () [inline]


Constructor:.

Member Function Documentation

String Phoneme::predefinedTranslations::translate (String str) [inline]


Gets key to dictionary, seeks it in dictionary, and returns it's mapping.
Parameters:

str Latin string to translate
Returns:

Value of mapping if str exists in List, or else null
The documentation for this class was generated from the following file:

  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/predefinedTranslations.cs

Phoneme::StringTrie Class Reference


trie data structure (DS) holds strings efficiently, O(wordlength) as complexity of finding one newWord at this DS. generic for any alphabeth specified. Implements WordlistDBInterface

Public Member Functions


  • StringTrie (int numOfLetters, char firstAlphabetLetter)

Constructor.

  • bool add (String newWord)

adds string to DS

  • void print ()

Prints all items in DS to trace to listbox l.

  • bool find (string toFind)

returns true iff toFind string exists in DS

  • bool initFromFile (String filename)

Initialise trie DS with strings read from file "filename".

Public Attributes


  • ulong m_Length = 0

Number of items (words) in trie.

Detailed Description


trie data structure (DS) holds strings efficiently, O(wordlength) as complexity of finding one newWord at this DS. generic for any alphabeth specified. Implements WordlistDBInterface

Constructor & Destructor Documentation

Phoneme::StringTrie::StringTrie (int numOfLetters, char firstAlphabetLetter) [inline]


Constructor.
Parameters:

numOfLetters number of letters in alphabeth

firstAlphabetLetter unicode value of first letter in alphabeth

Member Function Documentation

bool Phoneme::StringTrie::add (String newWord) [inline]


adds string to DS
Parameters:

newWord String to add
Returns:

true if succeded

Implements Phoneme::WordlistDBInterface (p.61).void Phoneme::StringTrie::print () [inline]


Prints all items in DS to trace to listbox l.

Implements Phoneme::WordlistDBInterface (p.62).bool Phoneme::StringTrie::find (string toFind) [inline]


returns true iff toFind string exists in DS
Parameters:

toFind string to find
Returns:

true iff string exists in DS

Implements Phoneme::WordlistDBInterface (p.62).bool Phoneme::StringTrie::initFromFile (String filename) [inline]


Initialise trie DS with strings read from file "filename".
Parameters:

filename file holds list of items (strings) to insert to DS assuming each word is the only one in its ilne in file
Returns:

true iff succeded to init DS

Implements Phoneme::WordlistDBInterface (p.62).


Member Data Documentation

ulong Phoneme::StringTrie::m_Length = 0


Number of items (words) in trie.
The documentation for this class was generated from the following file:

  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/StringTrie.cs

Phoneme::TrieNode Class Reference


class represnets string trie data structure node. Data of node is any character and if newWord ends in this node


Public Member Functions


  • TrieNode (int numOfLetters)

Constructor: throws ArgumentOutOfRangeException if negative numOfLettrs Allocates next array of next nodes (children's array).

  • TrieNode (int numOfLetters, bool isWordEnd)

Constructor: throws ArgumentOutOfRangeException if negative numOfLettrs Allocates next array of next nodes (children's array).

  • void print ()

traces node's data to

  • char getChar ()

getter

  • void setChar (char c)

setter

Public Attributes


  • bool m_isWordEnd = false

true if Data structure has a newWord that ends in this node

Detailed Description


class represnets string trie data structure node. Data of node is any character and if newWord ends in this node

Constructor & Destructor Documentation

Phoneme::TrieNode::TrieNode (int numOfLetters) [inline]


Constructor: throws ArgumentOutOfRangeException if negative numOfLettrs Allocates next array of next nodes (children's array).
Parameters:

numOfLetters num of letters in alphabeth of trie (positive num)

Phoneme::TrieNode::TrieNode (int numOfLetters, bool isWordEnd) [inline]


Constructor: throws ArgumentOutOfRangeException if negative numOfLettrs Allocates next array of next nodes (children's array).
Parameters:

numOfLetters num of letters in alphabeth of trie (positive num)

isWordEnd true iff Data structure has a newWord which ends in this node

Member Function Documentation

void Phoneme::TrieNode::print () [inline]


traces node's data to

char Phoneme::TrieNode::getChar () [inline]


getter
Returns:

Data of this node ( a character )

void Phoneme::TrieNode::setChar (char c) [inline]


setter
Parameters:

c sets data for this node (a character)

Member Data Documentation

bool Phoneme::TrieNode::m_isWordEnd = false


true if Data structure has a newWord that ends in this node
The documentation for this class was generated from the following file:

  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/StringTrie.cs

Phoneme::Win32API Class Reference


Wrapper class for win32 api functions.

Public Types


  • enum HookType

Windows hook types.

  • enum WindowsMessages

Windows message types.

Classes


  • struct POINT

stucture of point on screen, used by KBDLLHOOKSTRUCT

Detailed Description


Wrapper class for win32 api functions.

Member Enumeration Documentation

enum Phoneme::Win32API::HookType


Windows hook types.

enum Phoneme::Win32API::WindowsMessages


Windows message types.
The documentation for this class was generated from the following file:

  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/Win32API.cs

Phoneme::Win32API::POINT Struct Reference


stucture of point on screen, used by KBDLLHOOKSTRUCT


Detailed Description


stucture of point on screen, used by KBDLLHOOKSTRUCT
The documentation for this struct was generated from the following file:

  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/Win32API.cs



Phoneme::WordlistDBInterface Interface Reference


Define interface of data structure which can hold word lists (strings).

Inherited by Phoneme::StringTrie.



Public Member Functions


  • bool add (String word)

add string to DS

  • void print ()

print all elements in DS

  • bool find (string toFind)

find an item (string) in DS

  • bool initFromFile (String filename)

Initialize DS with Strings from file.

Detailed Description


Define interface of data structure which can hold word lists (strings).

Member Function Documentation

bool Phoneme::WordlistDBInterface::add (String word)


add string to DS
Parameters:

word string to add
Returns:

true iff added successfully

Implemented in Phoneme::StringTrie (p.54).void Phoneme::WordlistDBInterface::print ()


print all elements in DS

Implemented in Phoneme::StringTrie (p.54).bool Phoneme::WordlistDBInterface::find (string toFind)


find an item (string) in DS
Parameters:

toFind String to find
Returns:

true iff found string in DS

Implemented in Phoneme::StringTrie (p.54).bool Phoneme::WordlistDBInterface::initFromFile (String filename)


Initialize DS with Strings from file.
Parameters:

filename name of file to read
Returns:

true iff succeeded initializing DS

.

The documentation for this interface was generated from the following file:



  • My Documents/My Courses/Software-Project/The New Project/Phoneme/Phoneme/WordlistDBInterface.c



The End





  • Many thanks to our dedicated supervisor, Nissim Natanov

  • Thanks for the software lab staff for his technical and mental support (Ilana David and Victor Kulik)





Download 266.03 Kb.

Share with your friends:
1   2   3   4   5   6




The database is protected by copyright ©ininet.org 2024
send message

    Main page