Most of the application's features can be scripted using Visual Basic (VB), Visual Basic for Applications (VBA), and other COM-aware languages (including C++). This makes Felix a flexible and powerful tool. You can build your own custom scripts to automatically perform various tasks, pre-process documents, and more.
In fact, the various interfaces for Microsoft Word, PowerPoint, and Excel that come with this application, as well as the Tag Assist translator's HTML editor, take advantage of this very feature to perform their magic. You can customize these scripts to your own purposes, or write new ones. You can also write VB or other applications that take advantage of these features.
Properties
Methods
Sample Code
| Name | Type | Read | Write | Description |
|---|---|---|---|---|
CorrectedTranslation |
String |
|
|
Get or correct the currently displayed translation |
GlossaryLocation |
String |
|
|
Get or set the filename of the main glossary. |
GlossarySize |
Long |
|
|
Get the size of the main glossary. |
IsVisible |
Boolean |
|
|
Show/hide the Memory window, and detect whether it is visible. |
MemoryLocation |
String |
|
|
Get or set the filename of the memory. |
MemorySize |
Long |
|
|
Get the size of the memory. |
NumGlossaryMatches |
Integer |
|
|
Get the number of matches in the Main glossary. |
NumMatches |
Long |
|
|
Get the number of matches in the memory. |
Query |
String |
|
|
Get or set the current query. Setting the query causes the Memory window to search for matches in the current memory, and the Glossary windows to look for matches in their glossaries. |
RegistryValue |
String |
|
|
Get or set a value in the registry.[1] RegistryValue is called with two string arguments, the app name and key. |
Score |
Double |
|
|
Get the score of the currently displayed match. |
Translation |
String |
|
|
Get or set the translation for the current query. Setting the translation creates a new memory entry, with the query as the source and the translation as the translation. |
TranslationForReview |
String |
|
|
Look up a translation in the memory, or retrieve the current translation |
1. The advantages of setting registry values through Felix rather than on your own are that:
| Method Name | Parameters | Return Value | Action |
|---|---|---|---|
AddEntryToGlossary |
String Source, String Translation,
String Context |
None | Add an entry to the glossary. |
AddGlossaryEntry |
String Translation |
None | Add an entry to the glossary. The source is the current query in the Memory window. |
AddMemoryEntry |
String Source, String Translation |
None | Add an entry to the memory. |
ClearGlossary |
None | None | Clear the Main Glossary window memory. |
ClearMemory |
None | None | Clear the Memory window memory. |
Concordance |
String Query |
None | Search the memory for concordances. |
DeleteTranslation |
None | None | Delete the currently displayed translation. |
EditCurrentMemory |
None | None | Edit the currently displayed memory entry. Calls up the Edit Record dialog. |
GlossMatch |
Integer Index |
String | Get the glossary entry at position Index from the Main glossary. |
NextTranslation |
None | None | Show the next translation match. |
PrevTranslation |
None | None | Show the previous translation match. |
Quit |
None | None | Quit Felix. |
QuitSilently |
None | None | Quit without popping up confirmation dialog boxes (e.g. prompting user to save modified memories). |
Save |
None | None | Save the memory and Main glossary. |
ScoreAtIndex |
Integer Index |
Double |
Get the score of the match at index Index. |
TranslationAtIndex |
Integer Index |
String |
Get the translation of the match at index Index. |
TranslationConcordance |
String Query |
None | Get translation concordance for Query. |
Clear the glossary and memory
' You could also add the type library to the references and declare
' Dim felix As New FelixLib.App
Dim felix As Object
Set felix = CreateObject("Felix.App")
felix.ClearGlossary
felix.ClearMemory
Set a translation entry
Dim felix As Object
Set felix = CreateObject("Felix.App")
felix.Query = "No debes decir lo que no entiendes."
felix.Translation = "Where is the nearest post office?"
Set the query and translation
#include <string> // for wstring
// put this in your path or use the absolute path
#import "Felix.tlb" no_auto_exclude
// Note: obviously, these functions could live in a C++ object, which would eliminate the need to call
// CoCreateInstance every time. This is the approach that TagAssist uses. However, the sample has been
// condensed into two functions for brevity.
// set the current query
inline void set_query( const std::wstring &query )
{
CComPtr< FelixLib::IApp > felix ;
// error handling omitted for brevity
felix.CoCreateInstance( L"Felix.App", NULL, CLSCTX_LOCAL_SERVER|CLSCTX_INPROC_SERVER ) ;
// make it visible
felix->Visible = VARIANT_TRUE ;
// put the query
// Felix will respond by showing a list of any matches
CComBSTR bQuery( query.c_str() );
felix->Query = bQuery ;
}
// set the translation for the current query
inline void set_trans( const std::wstring &trans )
{
CComPtr< FelixLib::IApp > felix ;
// error handling omitted for brevity
felix.CoCreateInstance( L"Felix.App", NULL, CLSCTX_LOCAL_SERVER|CLSCTX_INPROC_SERVER ) ;
// make it visible
felix->Visible = VARIANT_TRUE ;
// put the translation
// If there is a current query, this will create a new entry, with the query as the
// source and the trans as the translation.
CComBSTR bTrans( trans.c_str() ) ;
felix->Translation = bTrans ;
}