You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Andrea Turbati <tu...@info.uniroma2.it> on 2016/07/11 10:50:37 UTC
Type in an FSList starting from the TypeSystem
Hi,
is there a way to access the type of a FSList from the TypeSystem?
I've tried with the following code:
FeatureDescription featureDescription =
TypeSystemUtil.feature2FeatureDescription(feature);
String typeStringOfList = featureDescription.getElementType();
but I always get a null in the variable typeStringOfList, even if the
description of such method is:
"For a feature with a range type that is an array or list, gets the
expected type of the elements of that array or list. This is optional;
if ommitted the array or list can contain any type. There is currently
no guarantee that the framework will enforce this type restriction. This
property should not be set for features whose range type is not an array
or list."
Thanks in advance for your feedback,
Andrea
--
-------------------------------------------------
Dott. Andrea Turbati, PhD
AI Research Group,
Dept. of Enterprise Engineering
University of Roma, Tor Vergata
Via del Politecnico 1 00133 ROMA (ITALY)
tel: +39 06 7259 7334
lab: +39 06 7259 7332
e_mail: turbati@info.uniroma2.it
home page: http://art.uniroma2.it/turbati/
--------------------------------------------------
Re: Type in an FSList starting from the TypeSystem
Posted by Richard Eckart de Castilho <re...@apache.org>.
On 11.07.2016, at 15:21, Andrea Turbati <tu...@info.uniroma2.it> wrote:
>
> Yes, I've looked the source code and it seems to me that it should works only for Arrays . Is there no other way to see the the Type contained in a FSList ?
I *think* that the element type should also be set for list types and that this is simply missing from this particular part of the code... but I am not sure.
It would be a good idea to check whether the element type is available from a Feature when starting from a typesystem description. What you are doing is starting from a Feature.
Cheers,
-- Richard
Re: Type in an FSList starting from the TypeSystem
Posted by Andrea Turbati <tu...@info.uniroma2.it>.
Yes, I've looked the source code and it seems to me that it should works
only for Arrays . Is there no other way to see the the Type contained in
a FSList ?
Thanks,
Andrea
Il 11/07/2016 13:55, Richard Eckart de Castilho ha scritto:
> Sounds like it may be a bug. The TypeSystemUtil.feature2FeatureDescription() method seems to set elementType only for array-type features and only if the elementType is not TOP.
>
> Cheers,
>
> -- Richard
>
>> On 11.07.2016, at 12:50, Andrea Turbati <tu...@info.uniroma2.it> wrote:
>>
>> Hi,
>> is there a way to access the type of a FSList from the TypeSystem?
>> I've tried with the following code:
>>
>> FeatureDescription featureDescription = TypeSystemUtil.feature2FeatureDescription(feature);
>> String typeStringOfList = featureDescription.getElementType();
>>
>> but I always get a null in the variable typeStringOfList, even if the description of such method is:
>>
>> "For a feature with a range type that is an array or list, gets the expected type of the elements of that array or list. This is optional; if ommitted the array or list can contain any type. There is currently no guarantee that the framework will enforce this type restriction. This property should not be set for features whose range type is not an array or list."
>>
>> Thanks in advance for your feedback,
>>
>> Andrea
>
--
-------------------------------------------------
Dott. Andrea Turbati, PhD
AI Research Group,
Dept. of Enterprise Engineering
University of Roma, Tor Vergata
Via del Politecnico 1 00133 ROMA (ITALY)
tel: +39 06 7259 7334
lab: +39 06 7259 7332
e_mail: turbati@info.uniroma2.it
home page: http://art.uniroma2.it/turbati/
--------------------------------------------------
Re: Type in an FSList starting from the TypeSystem
Posted by Richard Eckart de Castilho <re...@apache.org>.
Sounds like it may be a bug. The TypeSystemUtil.feature2FeatureDescription() method seems to set elementType only for array-type features and only if the elementType is not TOP.
Cheers,
-- Richard
> On 11.07.2016, at 12:50, Andrea Turbati <tu...@info.uniroma2.it> wrote:
>
> Hi,
> is there a way to access the type of a FSList from the TypeSystem?
> I've tried with the following code:
>
> FeatureDescription featureDescription = TypeSystemUtil.feature2FeatureDescription(feature);
> String typeStringOfList = featureDescription.getElementType();
>
> but I always get a null in the variable typeStringOfList, even if the description of such method is:
>
> "For a feature with a range type that is an array or list, gets the expected type of the elements of that array or list. This is optional; if ommitted the array or list can contain any type. There is currently no guarantee that the framework will enforce this type restriction. This property should not be set for features whose range type is not an array or list."
>
> Thanks in advance for your feedback,
>
> Andrea