On 5/25/07, Thilo Goetz <[EMAIL PROTECTED]> wrote:
Technically, the proposal consists of a new built-in type and new built-in
index as follows.

- a type uima.cas.FsVariable that inherits from uima.cas.TOP with features
  name:String, type:String and value:TOP.

The feature called "value", as type TOP, can only hold a reference to
another FS. So, it is not possible to create an FsVariable with a
double valued feature, or with an Integer feature, etc. As you say, it
is an "FS variable".

I'm still a little fuzzy about the scope of what can be done with this
proposal. Looking back at the previous discussion, Adam said:

I think one use case is the "singleton" use case.  You could define a
"global variable" called myapp.documentMetadata and set its value to
an instance of myTypeSystem.DocumentMetadata.  Then all your
annotators could access it by getting the value of this global
variable.

The application has to create a custom type,
myTypeSystem.DocumentMetadata, which is good because it is documented
in the descriptors. So the FsVariable is a mechanism to get to the
single instance of a custom type.

I admit that the alternative of creating a custom set index for a type
is a bit much for most users.

Jorn said:
Imagine an Annotator which is a spam filter, it has to
put a tag to the CAS which say spam or no_spam.

The document language is also an example for a global variable.

These examples would not be covered because the FsVariable can only
point to another FS, not hold an arbitrary value; correct?

- a built-in set index over FsVariable, sorted by the name feature.

The APIs to define and access these critters would look as follows.

// Declare a new global variable/singleton FS
declareFsVariable(String name, Type type)

What happens when a variable is declared?


// Check if a variable of that name exists
isFsVariable(String name):boolean

// Get the value of variable
getFsVariableType(String name):Type

This just returns the String value for Type, yes?


// Get all variables of a given type
listFsVariables(Type type):List

What exactly is the List returned?

Thanks,
Eddie

Reply via email to