UIMA Fit and fsIndexCollection

2017-08-05 Thread William Colen
Hi,

I am having an issue with UIMA Fit and fsIndexCollection. I
configured META-INF/org.uimafit/fsindexes.txt to load the following
fsIndexCollection:



http://uima.apache.org/resourceSpecifier";>
  

  MyFsIndexDescription
  myproject.uima.ts.ShiftedAnnotation
  sorted
  

  begin
  standard


  end
  reverse


  index
  standard

  

  


Debugging the code I can see that the file is loaded
by createFsIndexCollection() during initialization of the AEs.

But when I retrieve the annotation using JCasUtil.indexCovered(...) and the
"index" and I never get the result ordered by index if begin and end are
equal.

Any idea why?

Thank you,
William


Re: UIMA C++ in a Mac

2016-12-23 Thread William Colen
David,

I created a few issues with patch attached that can help building UIMA C++
in Mac OS X.

 UIMA-5234: UIMA C++ is compatible with APR 1.5.x
<https://issues.apache.org/jira/browse/UIMA-5234>
 UIMA-5235: Update UIMAC++ build Mac OSX instructions
<https://issues.apache.org/jira/browse/UIMA-5235>
 UIMA-5236: Can not compile UIMA C++ examples in Mac OS X
<https://issues.apache.org/jira/browse/UIMA-5236>

Regards,
William

2016-12-20 14:31 GMT-02:00 William Colen :

> Sorry, I had to try/change so many things that I am not sure. Maybe you
> can try the same and check if anything is missing.
>
> brew:
> apr, icu4c, xerces-c, gcc5
>
> base.mak:
>
> # include directory for compile
> INCLUDES=-I/usr/local/uimacpp/include 
> -I/usr/local/opt/apr/libexec/include/apr-1
> -I/usr/local/opt/icu4c/include -I/usr/local/opt/xerces-c/include
>
> LINKFLAGS= $(DLL_LINKFLAGS) $(BIN_LINKFLAGS) \
> $(USER_LINKFLAGS) $(BUILD_LFLAGS) \
> -L/usr/local/uimacpp/lib -L/usr/local/opt/apr/libexec/lib
> -L/usr/local/opt/icu4c/lib -L/usr/local/opt/xerces-c/lib -lxerces-c -licuuc
> -licuio -licui18n -licudata -ldl -luima $(EXTRA_LINK_LIBS)
>
> # compiler to use
> CC=g++-5
>
>
> 2016-12-20 13:48 GMT-02:00 Fox, David :
>
>> Great!
>>
>> Could you send a diff or patch of base.mak, and the list things you asked
>> BREW to install (if you have it)?
>>
>> David
>>
>> On 12/20/16, 10:39 AM, "William Colen"  wrote:
>>
>> >Hello!
>> >
>> >Good news! I managed to build UIMA C++ in macOS Sierra.
>> >
>> >I downloaded the UIMA C++ source code and followed the README. I had to
>> >install all dependencies and GCC 5 using BREW.
>> >
>> >The final configure command was like this:
>> >
>> >CC=gcc-5 CXX=g++-5 ../configure
>> >--with-jdk=/Applications/Xcode.app/Contents/Developer/Platf
>> orms/MacOSX.pla
>> >tform/Developer/SDKs/MacOSX10.12.sdk/System/Library/
>> Frameworks/JavaVM.fram
>> >ework/Versions/A/Headers
>> >--with-apr=/usr/local/opt/apr --with-icu=/usr/local/opt/icu4c
>> >--with-activemq=/usr/local/opt/activemq-cpp
>> >--with-apr-util=/usr/local/opt/apr-util --without-activemq
>> >
>> >
>> >I also had to change the base.mak, fixing the includes and libs.
>> >
>> >
>> >Thank you,
>> >
>> >William
>> >
>> >2016-11-28 15:06 GMT-02:00 David Fox :
>> >
>> >> I tried this a couple of months back and got the same error.
>> >>
>> >> Eventually I gave up on Mac OS X and got it working on linux.  In our
>> >> case, we use Mac OS X laptops for testing, but our production
>> >>environment
>> >> is linux, so this wasn¹t a big deal and I didn¹t pursue it further.  If
>> >>I
>> >> really did need to test on Mac OS X, my plan was to install virtual box
>> >> and run a linux VM on my Mac laptop.
>> >>
>> >>
>> >> David
>> >>
>> >>
>> >>
>> >> On 11/25/16, 5:07 PM, "William Colen"  wrote:
>> >>
>> >> >Hi,
>> >> >
>> >> >I need to execute a NLTK based POS Tagger. I was trying to create a
>> >>C++ AE
>> >> >for that. Do you think it will work?
>> >> >
>> >> >I installed UIMA C++ 2.4.0 on top of UIMA 2.9.0.
>> >> >
>> >> >When I try to execute the installation instruction I get some
>> >>compilation
>> >> >errors, like follows:
>> >> >
>> >> >$ make -f ExampleApplication.mak
>> >> >g++ -Wall -x c++ -DDEBUG -g -fno-inline -fPIC  -fno-default-inline
>> >> >-I/Users/user/programs/apache-uima/uimacpp/include
>> >> >-I/Users/user/programs/apache-uima/uimacpp/include/apr-1
>> >>-Wno-deprecated
>> >> >-c ExampleApplication.cpp
>> >> >clang: warning: optimization flag '-fno-default-inline' is not
>> >>supported
>> >> >In file included from ExampleApplication.cpp:20:
>> >> >In file included from
>> >> >/Users/user/programs/apache-uima/uimacpp/include/uima/api.hpp:36:
>> >> >In file included from
>> >> >/Users/user/programs/apache-uima/uimacpp/include/uima/annot
>> >> ator_context.hp
>> >> >p:48:
>> >> >In file included from
>> >> >/Users/user/programs/apache-uima/uimacpp/include/uima/engine.hpp:47:
>> >> >In file i

Re: Help with Pythonnator

2016-12-23 Thread William Colen
I reproduced the issue with Ubuntu 16.04.
I created the Jira UIMA-5237
 with a patch candidate.

Thank you,
William

2016-12-20 17:45 GMT-02:00 :

> Now that I managed to install UIMA C++ in macOS Sierra, I need to build
> the sample Pythonnator project.
>
> I am getting the following error:
>
> $ cd $UIMACPP_HOME/scriptators/python
> $ make
> g++-5 -Wall -x c++ -DDEBUG -g -fno-inline -fno-default-inline -fPIC
>  -I/usr/local/uimacpp/include -I/usr/local/opt/apr/libexec/include/apr-1
> -I/usr/local/opt/icu4c/include -I/usr/local/opt/xerces-c/include -g
> -I/usr/include/python2.7 -DSWIG3_0_10 -DPYTHONLIBRARYNAME=\"libpytho
> n2.7.so\" -DPYTHON2_7 -Wno-deprecated -c pythonnator.cpp
> pythonnator.cpp: In member function 'virtual uima::TyErrorId
> Pythonnator::initialize(uima::AnnotatorContext&)':
> pythonnator.cpp:192:56: error: too few arguments to function
> 'swig_module_info* SWIG_Python_GetModule(void*)'
>swig_module_info *module = SWIG_Python_GetModule();
> ^
> In file included from pythonnator.cpp:57:0:
> uimapywrap.h:2642:1: note: declared here
>  SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
>  ^
> pythonnator.cpp:235:22: error: invalid conversion from 'void*' to
> 'PyObject* {aka _object*}' [-fpermissive]
> ac_type, 0);
>   ^
> pythonnator.cpp:235:22: error: too few arguments to function 'PyObject*
> SWIG_Python_NewPointerObj(PyObject*, void*, swig_type_info*, int)'
> In file included from pythonnator.cpp:57:0:
> uimapywrap.h:2575:1: note: declared here
>  SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info
> *type, int flags) {
>  ^
> pythonnator.cpp: In member function 'virtual uima::TyErrorId
> Pythonnator::typeSystemInit(const uima::TypeSystem&)':
> pythonnator.cpp:289:18: error: invalid conversion from 'void*' to
> 'PyObject* {aka _object*}' [-fpermissive]
> ts_type, 0);
>   ^
> pythonnator.cpp:289:18: error: too few arguments to function 'PyObject*
> SWIG_Python_NewPointerObj(PyObject*, void*, swig_type_info*, int)'
> In file included from pythonnator.cpp:57:0:
> uimapywrap.h:2575:1: note: declared here
>  SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info
> *type, int flags) {
>  ^
> pythonnator.cpp: In member function 'virtual uima::TyErrorId
> Pythonnator::process(uima::CAS&, const uima::ResultSpecification&)':
> pythonnator.cpp:362:53: error: invalid conversion from 'void*' to
> 'PyObject* {aka _object*}' [-fpermissive]
> reinterpret_cast( &_cas), cas_type, 0);
>  ^
> pythonnator.cpp:362:53: error: too few arguments to function 'PyObject*
> SWIG_Python_NewPointerObj(PyObject*, void*, swig_type_info*, int)'
> In file included from pythonnator.cpp:57:0:
> uimapywrap.h:2575:1: note: declared here
>  SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info
> *type, int flags) {
>  ^
> pythonnator.cpp:372:18: error: invalid conversion from 'void*' to
> 'PyObject* {aka _object*}' [-fpermissive]
> rs_type, 0);
>   ^
> pythonnator.cpp:372:18: error: too few arguments to function 'PyObject*
> SWIG_Python_NewPointerObj(PyObject*, void*, swig_type_info*, int)'
> In file included from pythonnator.cpp:57:0:
> uimapywrap.h:2575:1: note: declared here
>  SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info
> *type, int flags) {
>  ^
> make: *** [pythonnator.o] Error 1
>
> ---
>
> $ swig -version
>
>
> SWIG Version 3.0.10
>
>
> Compiled with clang++ [x86_64-apple-darwin16.1.0]
>
>
> Configured options: +pcre
>
>
> Please see http://www.swig.org for reporting bugs and further information
>
>
> 
>
>
> $ python --version
>
> Python 2.7.10
>
>
>
> Anyone have a clue how to fix this?
>
>
> Thank you,
>
> William
>
>
>
>


Help with Pythonnator

2016-12-20 Thread William Colen
Now that I managed to install UIMA C++ in macOS Sierra, I need to build the
sample Pythonnator project.

I am getting the following error:

$ cd $UIMACPP_HOME/scriptators/python
$ make
g++-5 -Wall -x c++ -DDEBUG -g -fno-inline -fno-default-inline -fPIC
 -I/usr/local/uimacpp/include -I/usr/local/opt/apr/libexec/include/apr-1
-I/usr/local/opt/icu4c/include -I/usr/local/opt/xerces-c/include -g
-I/usr/include/python2.7 -DSWIG3_0_10 -DPYTHONLIBRARYNAME=\"libpython2.7.so\"
-DPYTHON2_7 -Wno-deprecated -c pythonnator.cpp
pythonnator.cpp: In member function 'virtual uima::TyErrorId
Pythonnator::initialize(uima::AnnotatorContext&)':
pythonnator.cpp:192:56: error: too few arguments to function
'swig_module_info* SWIG_Python_GetModule(void*)'
   swig_module_info *module = SWIG_Python_GetModule();
^
In file included from pythonnator.cpp:57:0:
uimapywrap.h:2642:1: note: declared here
 SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
 ^
pythonnator.cpp:235:22: error: invalid conversion from 'void*' to
'PyObject* {aka _object*}' [-fpermissive]
ac_type, 0);
  ^
pythonnator.cpp:235:22: error: too few arguments to function 'PyObject*
SWIG_Python_NewPointerObj(PyObject*, void*, swig_type_info*, int)'
In file included from pythonnator.cpp:57:0:
uimapywrap.h:2575:1: note: declared here
 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type,
int flags) {
 ^
pythonnator.cpp: In member function 'virtual uima::TyErrorId
Pythonnator::typeSystemInit(const uima::TypeSystem&)':
pythonnator.cpp:289:18: error: invalid conversion from 'void*' to
'PyObject* {aka _object*}' [-fpermissive]
ts_type, 0);
  ^
pythonnator.cpp:289:18: error: too few arguments to function 'PyObject*
SWIG_Python_NewPointerObj(PyObject*, void*, swig_type_info*, int)'
In file included from pythonnator.cpp:57:0:
uimapywrap.h:2575:1: note: declared here
 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type,
int flags) {
 ^
pythonnator.cpp: In member function 'virtual uima::TyErrorId
Pythonnator::process(uima::CAS&, const uima::ResultSpecification&)':
pythonnator.cpp:362:53: error: invalid conversion from 'void*' to
'PyObject* {aka _object*}' [-fpermissive]
reinterpret_cast( &_cas), cas_type, 0);
 ^
pythonnator.cpp:362:53: error: too few arguments to function 'PyObject*
SWIG_Python_NewPointerObj(PyObject*, void*, swig_type_info*, int)'
In file included from pythonnator.cpp:57:0:
uimapywrap.h:2575:1: note: declared here
 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type,
int flags) {
 ^
pythonnator.cpp:372:18: error: invalid conversion from 'void*' to
'PyObject* {aka _object*}' [-fpermissive]
rs_type, 0);
  ^
pythonnator.cpp:372:18: error: too few arguments to function 'PyObject*
SWIG_Python_NewPointerObj(PyObject*, void*, swig_type_info*, int)'
In file included from pythonnator.cpp:57:0:
uimapywrap.h:2575:1: note: declared here
 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type,
int flags) {
 ^
make: *** [pythonnator.o] Error 1

---

$ swig -version


SWIG Version 3.0.10


Compiled with clang++ [x86_64-apple-darwin16.1.0]


Configured options: +pcre


Please see http://www.swig.org for reporting bugs and further information





$ python --version

Python 2.7.10



Anyone have a clue how to fix this?


Thank you,

William


Re: UIMA C++ in a Mac

2016-12-20 Thread William Colen
Sorry, I had to try/change so many things that I am not sure. Maybe you can
try the same and check if anything is missing.

brew:
apr, icu4c, xerces-c, gcc5

base.mak:

# include directory for compile
INCLUDES=-I/usr/local/uimacpp/include
-I/usr/local/opt/apr/libexec/include/apr-1 -I/usr/local/opt/icu4c/include
-I/usr/local/opt/xerces-c/include

LINKFLAGS= $(DLL_LINKFLAGS) $(BIN_LINKFLAGS) \
$(USER_LINKFLAGS) $(BUILD_LFLAGS) \
-L/usr/local/uimacpp/lib -L/usr/local/opt/apr/libexec/lib
-L/usr/local/opt/icu4c/lib -L/usr/local/opt/xerces-c/lib -lxerces-c -licuuc
-licuio -licui18n -licudata -ldl -luima $(EXTRA_LINK_LIBS)

# compiler to use
CC=g++-5


2016-12-20 13:48 GMT-02:00 Fox, David :

> Great!
>
> Could you send a diff or patch of base.mak, and the list things you asked
> BREW to install (if you have it)?
>
> David
>
> On 12/20/16, 10:39 AM, "William Colen"  wrote:
>
> >Hello!
> >
> >Good news! I managed to build UIMA C++ in macOS Sierra.
> >
> >I downloaded the UIMA C++ source code and followed the README. I had to
> >install all dependencies and GCC 5 using BREW.
> >
> >The final configure command was like this:
> >
> >CC=gcc-5 CXX=g++-5 ../configure
> >--with-jdk=/Applications/Xcode.app/Contents/Developer/
> Platforms/MacOSX.pla
> >tform/Developer/SDKs/MacOSX10.12.sdk/System/
> Library/Frameworks/JavaVM.fram
> >ework/Versions/A/Headers
> >--with-apr=/usr/local/opt/apr --with-icu=/usr/local/opt/icu4c
> >--with-activemq=/usr/local/opt/activemq-cpp
> >--with-apr-util=/usr/local/opt/apr-util --without-activemq
> >
> >
> >I also had to change the base.mak, fixing the includes and libs.
> >
> >
> >Thank you,
> >
> >William
> >
> >2016-11-28 15:06 GMT-02:00 David Fox :
> >
> >> I tried this a couple of months back and got the same error.
> >>
> >> Eventually I gave up on Mac OS X and got it working on linux.  In our
> >> case, we use Mac OS X laptops for testing, but our production
> >>environment
> >> is linux, so this wasn¹t a big deal and I didn¹t pursue it further.  If
> >>I
> >> really did need to test on Mac OS X, my plan was to install virtual box
> >> and run a linux VM on my Mac laptop.
> >>
> >>
> >> David
> >>
> >>
> >>
> >> On 11/25/16, 5:07 PM, "William Colen"  wrote:
> >>
> >> >Hi,
> >> >
> >> >I need to execute a NLTK based POS Tagger. I was trying to create a
> >>C++ AE
> >> >for that. Do you think it will work?
> >> >
> >> >I installed UIMA C++ 2.4.0 on top of UIMA 2.9.0.
> >> >
> >> >When I try to execute the installation instruction I get some
> >>compilation
> >> >errors, like follows:
> >> >
> >> >$ make -f ExampleApplication.mak
> >> >g++ -Wall -x c++ -DDEBUG -g -fno-inline -fPIC  -fno-default-inline
> >> >-I/Users/user/programs/apache-uima/uimacpp/include
> >> >-I/Users/user/programs/apache-uima/uimacpp/include/apr-1
> >>-Wno-deprecated
> >> >-c ExampleApplication.cpp
> >> >clang: warning: optimization flag '-fno-default-inline' is not
> >>supported
> >> >In file included from ExampleApplication.cpp:20:
> >> >In file included from
> >> >/Users/user/programs/apache-uima/uimacpp/include/uima/api.hpp:36:
> >> >In file included from
> >> >/Users/user/programs/apache-uima/uimacpp/include/uima/annot
> >> ator_context.hp
> >> >p:48:
> >> >In file included from
> >> >/Users/user/programs/apache-uima/uimacpp/include/uima/engine.hpp:47:
> >> >In file included from
> >>
> >>>/Users/user/programs/apache-uima/uimacpp/include/
> uima/exceptions.hpp:88:
> >> >/Users/user/programs/apache-uima/uimacpp/include/uima/strto
> >> ols.hpp:731:14:
> >> >error: no member named 'operator void *' in
> >> >'std::__1::basic_istream'
> >> >  if (!i.operator void*())
> >> >   ~ ^
> >> >/Users/user/programs/apache-uima/uimacpp/include/uima/strto
> >> ols.hpp:737:18:
> >> >error: no member named 'operator void *' in
> >> >'std::__1::basic_istream'
> >> >  if (!i.operator void*())
> >> >   ~ ^
> >> >/Users/user/programs/apache-uima/uimacpp/include/uima/strto
> >> ols.hpp:1674:19
> >> >:
> >> >warning: comparison of constant 184467440

Re: UIMA C++ in a Mac

2016-12-20 Thread William Colen
Hello!

Good news! I managed to build UIMA C++ in macOS Sierra.

I downloaded the UIMA C++ source code and followed the README. I had to
install all dependencies and GCC 5 using BREW.

The final configure command was like this:

CC=gcc-5 CXX=g++-5 ../configure
--with-jdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
--with-apr=/usr/local/opt/apr --with-icu=/usr/local/opt/icu4c
--with-activemq=/usr/local/opt/activemq-cpp
--with-apr-util=/usr/local/opt/apr-util --without-activemq


I also had to change the base.mak, fixing the includes and libs.


Thank you,

William

2016-11-28 15:06 GMT-02:00 David Fox :

> I tried this a couple of months back and got the same error.
>
> Eventually I gave up on Mac OS X and got it working on linux.  In our
> case, we use Mac OS X laptops for testing, but our production environment
> is linux, so this wasn¹t a big deal and I didn¹t pursue it further.  If I
> really did need to test on Mac OS X, my plan was to install virtual box
> and run a linux VM on my Mac laptop.
>
>
> David
>
>
>
> On 11/25/16, 5:07 PM, "William Colen"  wrote:
>
> >Hi,
> >
> >I need to execute a NLTK based POS Tagger. I was trying to create a C++ AE
> >for that. Do you think it will work?
> >
> >I installed UIMA C++ 2.4.0 on top of UIMA 2.9.0.
> >
> >When I try to execute the installation instruction I get some compilation
> >errors, like follows:
> >
> >$ make -f ExampleApplication.mak
> >g++ -Wall -x c++ -DDEBUG -g -fno-inline -fPIC  -fno-default-inline
> >-I/Users/user/programs/apache-uima/uimacpp/include
> >-I/Users/user/programs/apache-uima/uimacpp/include/apr-1  -Wno-deprecated
> >-c ExampleApplication.cpp
> >clang: warning: optimization flag '-fno-default-inline' is not supported
> >In file included from ExampleApplication.cpp:20:
> >In file included from
> >/Users/user/programs/apache-uima/uimacpp/include/uima/api.hpp:36:
> >In file included from
> >/Users/user/programs/apache-uima/uimacpp/include/uima/annot
> ator_context.hp
> >p:48:
> >In file included from
> >/Users/user/programs/apache-uima/uimacpp/include/uima/engine.hpp:47:
> >In file included from
> >/Users/user/programs/apache-uima/uimacpp/include/uima/exceptions.hpp:88:
> >/Users/user/programs/apache-uima/uimacpp/include/uima/strto
> ols.hpp:731:14:
> >error: no member named 'operator void *' in
> >'std::__1::basic_istream'
> >  if (!i.operator void*())
> >   ~ ^
> >/Users/user/programs/apache-uima/uimacpp/include/uima/strto
> ols.hpp:737:18:
> >error: no member named 'operator void *' in
> >'std::__1::basic_istream'
> >  if (!i.operator void*())
> >   ~ ^
> >/Users/user/programs/apache-uima/uimacpp/include/uima/strto
> ols.hpp:1674:19
> >:
> >warning: comparison of constant 18446744073709551615 with expression of
> >type 'unsigned int' is always true
> >[-Wtautological-constant-out-of-range-compare]
> >if (envBegPos != STRING_NPOS) {
> >~ ^  ~~~
> >/Users/user/programs/apache-uima/uimacpp/include/uima/strto
> ols.hpp:1676:21
> >:
> >warning: comparison of constant 18446744073709551615 with expression of
> >type 'unsigned int' is always true
> >[-Wtautological-constant-out-of-range-compare]
> >  if (envEndPos != STRING_NPOS) {
> >  ~ ^  ~~~
> >In file included from ExampleApplication.cpp:20:
> >In file included from
> >/Users/user/programs/apache-uima/uimacpp/include/uima/api.hpp:36:
> >In file included from
> >/Users/user/programs/apache-uima/uimacpp/include/uima/annot
> ator_context.hp
> >p:48:
> >In file included from
> >/Users/user/programs/apache-uima/uimacpp/include/uima/engine.hpp:50:
> >In file included from
> >/Users/user/programs/apache-uima/uimacpp/include/uima/casiterator.hpp:37:
> >/Users/user/programs/apache-uima/uimacpp/include/uima/cas.hpp:1252:84:
> >error: default argument references parameter 'enAmbiguous'
> >ANIterator subIterator( Type const & crType, EnIteratorAmbiguity
> >enAmbiguous = enAmbiguous ) const;
> >
> >   ^~~
> >/Users/user/programs/apache-uima/uimacpp/include/uima/cas.hpp:1376:88:
> >error: default argument references parameter 'enAmbiguous'
> >ANIterator subIterator( AnnotationFS const & an, EnIteratorAmbiguity
> >enAmbiguous = enAmbiguous ) const;
> >
> >   ^~~~

Re: Sorting overlapping annotation of same type using UIMAFIT

2016-11-25 Thread William Colen
Great! Thank you!


2016-11-23 12:33 GMT-02:00 Marshall Schor :

> UIMA allows you to define custom indexes.  So you can define a new sorted
> index
> (for example, let's name it "nameOfYourNewIndex") that is like the
> annotator
> index, except that its keys are a) the begin feature, ascending, 2) the end
> feature, descending, and 3) the special extra feature you have to sort
> otherwise
> equal annotations.  You would define this index to be over the most
> specific
> type that is the type or supertype of all Feature Structures you want this
> index
> to apply to (let's say you have a JCas class for this, called
> JCasClassOfTheType).
>
> Then you can use uimaFIT's your own index (see docs), that include your
> extra
> feature.  Then you would use a form such as this:
>
> // get the index instance from the JCas
> FSIndex index = jcas.getIndex("nameOfYourNewIndex",
> JCasClassOfTheType);
>
> // get an iterator from the index
> FSIterator iterator = index.iterator();
>
> With this, there is no need to have the user first collect all the
> instances,
> and then sort them; UIMA does this for you.
>
> Hope this helps!  -Marshall
>
>
> On 11/21/2016 8:05 PM, William Colen wrote:
> > Thank you, Marshall.
> > What if they are of the same type?
> > The workaround for me was to add a feature I can store a integer which I
> > use to sort the annotations. It is not a good approach because the user
> > will need to remember to sort it before using.
> >
> > Thank you
> > William
> >
> > 2016-11-21 20:10 GMT-02:00 Marshall Schor :
> >
> >> The select form you're using iterates using UIMA's built-in Annotation
> >> index.
> >> This index is sorting the annotations based on 3 criteria:
> >>
> >> 1) the begin (ascending order)
> >>
> >> 2) the end (descending order)
> >>
> >> 3) the type priority
> >>
> >> You can use the 3rd criterion to set a preference ordering among two
> >> annotations
> >> of different types, which have the same begin / end.
> >> You specify the type priorities as part of Analysis Engine metadata, see
> >> http://uima.apache.org/d/uimaj-current/references.html#
> >> ugr.ref.xml.component_descriptor.aes.primitive
> >>
> >> -Marshall
> >>
> >> On 11/20/2016 9:52 PM, William Colen wrote:
> >>> Hi,
> >>>
> >>> In Portuguese we have contractions, that are words composed by, for
> >>> example, a preposition + article, pronoun or an adverb.
> >>>
> >>> Example:
> >>>
> >>> Nós acreditávamos nele. (We believed him.)
> >>>
> >>> Where "nele" can be divided into "em" + "ele". (in + him)
> >>>
> >>> To properly analyze this, I created two token annotation with the same
> >>> begin and end, but the first I associated with the POS Tag preposition,
> >> and
> >>> the second pronoun.
> >>>
> >>> This is especially important when we are doing chunking, because the
> >> first
> >>> token will be part of a prepositional phrase, while the second of a
> >> nominal
> >>> phrase.
> >>>
> >>> How can I guarantee that when I call UIMAFit JCasUtil.select I will get
> >> the
> >>> tokens ordered, first the preposition, second the pronoun?
> >>>
> >>> Thank you,
> >>> William
> >>>
>
>


UIMA C++ in a Mac

2016-11-25 Thread William Colen
Hi,

I need to execute a NLTK based POS Tagger. I was trying to create a C++ AE
for that. Do you think it will work?

I installed UIMA C++ 2.4.0 on top of UIMA 2.9.0.

When I try to execute the installation instruction I get some compilation
errors, like follows:

$ make -f ExampleApplication.mak
g++ -Wall -x c++ -DDEBUG -g -fno-inline -fPIC  -fno-default-inline
-I/Users/user/programs/apache-uima/uimacpp/include
-I/Users/user/programs/apache-uima/uimacpp/include/apr-1  -Wno-deprecated
-c ExampleApplication.cpp
clang: warning: optimization flag '-fno-default-inline' is not supported
In file included from ExampleApplication.cpp:20:
In file included from
/Users/user/programs/apache-uima/uimacpp/include/uima/api.hpp:36:
In file included from
/Users/user/programs/apache-uima/uimacpp/include/uima/annotator_context.hpp:48:
In file included from
/Users/user/programs/apache-uima/uimacpp/include/uima/engine.hpp:47:
In file included from
/Users/user/programs/apache-uima/uimacpp/include/uima/exceptions.hpp:88:
/Users/user/programs/apache-uima/uimacpp/include/uima/strtools.hpp:731:14:
error: no member named 'operator void *' in 'std::__1::basic_istream'
  if (!i.operator void*())
   ~ ^
/Users/user/programs/apache-uima/uimacpp/include/uima/strtools.hpp:737:18:
error: no member named 'operator void *' in 'std::__1::basic_istream'
  if (!i.operator void*())
   ~ ^
/Users/user/programs/apache-uima/uimacpp/include/uima/strtools.hpp:1674:19:
warning: comparison of constant 18446744073709551615 with expression of
type 'unsigned int' is always true
[-Wtautological-constant-out-of-range-compare]
if (envBegPos != STRING_NPOS) {
~ ^  ~~~
/Users/user/programs/apache-uima/uimacpp/include/uima/strtools.hpp:1676:21:
warning: comparison of constant 18446744073709551615 with expression of
type 'unsigned int' is always true
[-Wtautological-constant-out-of-range-compare]
  if (envEndPos != STRING_NPOS) {
  ~ ^  ~~~
In file included from ExampleApplication.cpp:20:
In file included from
/Users/user/programs/apache-uima/uimacpp/include/uima/api.hpp:36:
In file included from
/Users/user/programs/apache-uima/uimacpp/include/uima/annotator_context.hpp:48:
In file included from
/Users/user/programs/apache-uima/uimacpp/include/uima/engine.hpp:50:
In file included from
/Users/user/programs/apache-uima/uimacpp/include/uima/casiterator.hpp:37:
/Users/user/programs/apache-uima/uimacpp/include/uima/cas.hpp:1252:84:
error: default argument references parameter 'enAmbiguous'
ANIterator subIterator( Type const & crType, EnIteratorAmbiguity
enAmbiguous = enAmbiguous ) const;

   ^~~
/Users/user/programs/apache-uima/uimacpp/include/uima/cas.hpp:1376:88:
error: default argument references parameter 'enAmbiguous'
ANIterator subIterator( AnnotationFS const & an, EnIteratorAmbiguity
enAmbiguous = enAmbiguous ) const;

   ^~~
ExampleApplication.cpp:207:12: warning: unused variable 'numread'
[-Wunused-variable]
size_t numread = fread(pBuffer,1,filesize,pFile);
   ^
In file included from ExampleApplication.cpp:20:
In file included from
/Users/user/programs/apache-uima/uimacpp/include/uima/api.hpp:59:
/Users/user/programs/apache-uima/uimacpp/include/uima/annotator_abase.hpp:138:24:
warning: private field 'iv_typeSystem' is not used [-Wunused-private-field]
TypeSystem const * iv_typeSystem;
   ^
4 warnings and 4 errors generated.
make: *** [ExampleApplication.o] Error 1




What I am missing?

Thank you,
William


Re: Sorting overlapping annotation of same type using UIMAFIT

2016-11-21 Thread William Colen
Thank you, Marshall.
What if they are of the same type?
The workaround for me was to add a feature I can store a integer which I
use to sort the annotations. It is not a good approach because the user
will need to remember to sort it before using.

Thank you
William

2016-11-21 20:10 GMT-02:00 Marshall Schor :

> The select form you're using iterates using UIMA's built-in Annotation
> index.
> This index is sorting the annotations based on 3 criteria:
>
> 1) the begin (ascending order)
>
> 2) the end (descending order)
>
> 3) the type priority
>
> You can use the 3rd criterion to set a preference ordering among two
> annotations
> of different types, which have the same begin / end.
> You specify the type priorities as part of Analysis Engine metadata, see
> http://uima.apache.org/d/uimaj-current/references.html#
> ugr.ref.xml.component_descriptor.aes.primitive
>
> -Marshall
>
> On 11/20/2016 9:52 PM, William Colen wrote:
> > Hi,
> >
> > In Portuguese we have contractions, that are words composed by, for
> > example, a preposition + article, pronoun or an adverb.
> >
> > Example:
> >
> > Nós acreditávamos nele. (We believed him.)
> >
> > Where "nele" can be divided into "em" + "ele". (in + him)
> >
> > To properly analyze this, I created two token annotation with the same
> > begin and end, but the first I associated with the POS Tag preposition,
> and
> > the second pronoun.
> >
> > This is especially important when we are doing chunking, because the
> first
> > token will be part of a prepositional phrase, while the second of a
> nominal
> > phrase.
> >
> > How can I guarantee that when I call UIMAFit JCasUtil.select I will get
> the
> > tokens ordered, first the preposition, second the pronoun?
> >
> > Thank you,
> > William
> >
>
>


Sorting overlapping annotation of same type using UIMAFIT

2016-11-20 Thread William Colen
Hi,

In Portuguese we have contractions, that are words composed by, for
example, a preposition + article, pronoun or an adverb.

Example:

Nós acreditávamos nele. (We believed him.)

Where "nele" can be divided into "em" + "ele". (in + him)

To properly analyze this, I created two token annotation with the same
begin and end, but the first I associated with the POS Tag preposition, and
the second pronoun.

This is especially important when we are doing chunking, because the first
token will be part of a prepositional phrase, while the second of a nominal
phrase.

How can I guarantee that when I call UIMAFit JCasUtil.select I will get the
tokens ordered, first the preposition, second the pronoun?

Thank you,
William


Re: Error using RUTA from Java

2015-05-21 Thread William Colen
Thank you, Peter.

Maybe that is the case. I am not setting any parameter, as follows:

TypeSystemDescription tsd =
> TypeSystemDescriptionFactory.createTypeSystemDescription("MainTypeSystem");
> URL url = Resources.getResource("Main.ruta");
> String scriptText = Resources.toString(url, Charsets.UTF_8);
> AnalysisEngineDescription aeDes =
> Ruta.createAnalysisEngineDescription(scriptText, tsd);
> AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aeDes);


Are there any tutorial explaining how to do that from command line? We can
execute everything correctly from Ruta tools for Eclipse.

The source code is open:

This is from where we call RUTA:
https://github.com/Fichberg/cogroo4/blob/labXP215_Will/cogroo-gc/src/main/java/org/cogroo/tools/checker/checkers/UIMAChecker.java

The scripts and the type system:

https://github.com/Fichberg/cogroo4/tree/labXP215_Will/cogroo-ruta


Thank you for your help!
William

2015-05-21 4:55 GMT-03:00 Peter Klügl :

> Hi,
>
> I must admit that I do not know the source of the problem yet.
>
> Either RutaParser.file_input() (or RutaEngine.loadScript/IS()) returns
> null, but this should cause some other exceptions. Or the linking of
> mentioned/imported script names in the ruta file does not match the
> names in the configuration parameters.
>
> Some questions to narrow down the problem:
> - Is the analysis engine configured correctly? Do the values of
> additionalScripts match the scripts imported in the main ruta file?
> - Are there any spaces in paths, or any period in file names?
> - Do you use the UIMA Ruta Workbench? If yes, are there any problems
> reported?
> - Are you able to load/process the analysis engine of the imported
> script for their own? Just to exclude some hidden parser error there.
> - Can you check if there are any typos in the file names?
> - Can you switch to absolute paths (scriptPaths, descriptorPaths,... )
> to rule out problems with the classloader approach?
> - Can you post the complete configuration of the analysis engine?
>
> If all fails, we need to debug... my first guess would be to investigate
> why there is a null value in RutaModule.setScriptDependencies() or why a
> module is not assigned in that map.
> If it is an option concerning non-disclosure, you can send me the files
> (or a small project where the problem can be reproduced) and I will
> debug it. (You can of course send it to me directly off-list).
>
> Best,
>
> Peter
>
> Am 21.05.2015 um 01:26 schrieb William Colen:
> > Thank you, Peter.
> >
> > I was using 2.2.1 and upgraded to 2.3.0 RC2 as you advised, but the error
> > persists. Now I will post the complete stacktrace:
> >
> > Mai 20, 2015 6:56:23 PM
> > org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl
> > callAnalysisComponentProcess(417)
> > GRAVE: Exception occurred
> > org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator
> > processing failed.
> > at
> >
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:401)
> > at
> >
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:308)
> > at
> >
> org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:269)
> > at
> org.cogroo.tools.checker.checkers.UIMAChecker.check(UIMAChecker.java:73)
> > at
> org.cogroo.tools.checker.checkers.UIMAChecker.check(UIMAChecker.java:1)
> > at
> >
> org.cogroo.tools.checker.TypedCheckerComposite.check(TypedCheckerComposite.java:49)
> > at org.cogroo.checker.GrammarChecker.analyze(GrammarChecker.java:252)
> > at org.cogroo.checker.GrammarChecker.analyze(GrammarChecker.java:271)
> > at
> org.cogroo.tools.checker.checkers.UIMAChecker.main(UIMAChecker.java:130)
> > Caused by: java.lang.NullPointerException
> > at
> >
> org.apache.uima.ruta.engine.RutaEngine.resetEnvironment(RutaEngine.java:580)
> > at
> >
> org.apache.uima.ruta.engine.RutaEngine.resetEnvironments(RutaEngine.java:575)
> > at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:530)
> > at
> >
> org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
> > at
> >
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:385)
> > ... 8 more
> >
> > org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator
> > processing failed.
> > at
> >
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_im

Re: Error using RUTA from Java

2015-05-20 Thread William Colen
(PrimitiveAnalysisEngine_impl.java:401)
at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:308)
at
org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:269)
at org.cogroo.tools.checker.checkers.UIMAChecker.check(UIMAChecker.java:73)
at org.cogroo.tools.checker.checkers.UIMAChecker.check(UIMAChecker.java:1)
at
org.cogroo.tools.checker.TypedCheckerComposite.check(TypedCheckerComposite.java:49)
at org.cogroo.checker.GrammarChecker.analyze(GrammarChecker.java:252)
at org.cogroo.checker.GrammarChecker.analyze(GrammarChecker.java:271)
at org.cogroo.tools.checker.checkers.UIMAChecker.main(UIMAChecker.java:130)
Caused by: java.lang.NullPointerException
at
org.apache.uima.ruta.engine.RutaEngine.resetEnvironment(RutaEngine.java:580)
at
org.apache.uima.ruta.engine.RutaEngine.resetEnvironments(RutaEngine.java:575)
at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:530)
at
org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:385)
... 8 more



2015-05-20 17:46 GMT-03:00 Peter Klügl :

> Hi,
>
> I assume that you use UIMA Ruta 2.2.1?
>
> Are there any prior exception?
>
> I had a similar problem, which should be fixed now. Could be related to
> the bugs reported in UIMA-4045 or UIMA-4046.
> Normally, I would assume that there is a syntax error in the additional
> script causing the module to be null. If the script file is not found, then
> there should be a clear error message.
>
> Could you try the UIMA Ruta 2.3.0 RC2, but upgrading the dependency
> version of uima-core to 2.3.0 and using the staging repository?
>
> 
> 
>   staged-release
> 
> https://repository.apache.org/content/repositories/orgapacheuima-1053/
> 
> 
>       
>
> Best,
>
> Peter
>
>
> Am 20.05.2015 um 21:45 schrieb William Colen:
>
>> Hello,
>>
>> We have a Main RUTA script that imports a few children scripts, as
>> follows:
>>
>> PACKAGE cogroo.ruta;
>>
>>> TYPESYSTEM BaseTypeSystem;
>>> IMPORT opennlp.uima.Token FROM TypeSystem AS cgToken;
>>> IMPORT opennlp.uima.Sentence FROM TypeSystem AS cgSentence;
>>> SCRIPT Crase;
>>> SCRIPT Base;
>>> Document{-> CALL(Base)};
>>> Document{-> CALL(Crase)};
>>>
>>
>> All the scripts are in the root of the classpath.
>>
>> We are trying to call it from Java, using the following code:
>>
>> TypeSystemDescription tsd =
>>
>>> TypeSystemDescriptionFactory.createTypeSystemDescription("MainTypeSystem"
>>> );
>>> URL url = Resources.getResource("Main.ruta");
>>> String scriptText = Resources.toString(url, Charsets.UTF_8);
>>> AnalysisEngineDescription aeDes =
>>> Ruta.createAnalysisEngineDescription(scriptText, tsd);
>>> AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aeDes);
>>>
>>
>>   The error we are getting:
>>
>> org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator
>>
>>> processing failed.
>>> at
>>>
>>> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:401)
>>> at
>>>
>>> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:309)
>>> at
>>>
>>> org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
>>> at
>>> org.cogroo.tools.checker.checkers.UIMAChecker.check(UIMAChecker.java:74)
>>> at
>>> org.cogroo.tools.checker.checkers.UIMAChecker.check(UIMAChecker.java:1)
>>> at
>>>
>>> org.cogroo.tools.checker.TypedCheckerComposite.check(TypedCheckerComposite.java:49)
>>> at org.cogroo.checker.GrammarChecker.analyze(GrammarChecker.java:252)
>>> at org.cogroo.checker.GrammarChecker.analyze(GrammarChecker.java:271)
>>> at
>>> org.cogroo.tools.checker.checkers.UIMAChecker.main(UIMAChecker.java:131)
>>> Caused by: java.lang.NullPointerException
>>> at
>>>
>>> org.apache.uima.ruta.engine.RutaEngine.resetEnvironment(RutaEngine.java:529)
>>> at
>>>
>>> org.apache.uima.ruta.engine.RutaEngine.resetEnvironments(RutaEngine.java:524)
>>> at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:480)
>>> at
>>>
>>> org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
>>> at
>>>
>>> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:385)
>>> ... 8 more
>>>
>>
>> We have a feeling that RUTA can't find the child script files, and that
>> causes the error. Are we missing something?
>>
>>
>> Thank you,
>> William
>>
>>
>


Error using RUTA from Java

2015-05-20 Thread William Colen
Hello,

We have a Main RUTA script that imports a few children scripts, as follows:

PACKAGE cogroo.ruta;
> TYPESYSTEM BaseTypeSystem;
> IMPORT opennlp.uima.Token FROM TypeSystem AS cgToken;
> IMPORT opennlp.uima.Sentence FROM TypeSystem AS cgSentence;
> SCRIPT Crase;
> SCRIPT Base;
> Document{-> CALL(Base)};
> Document{-> CALL(Crase)};


All the scripts are in the root of the classpath.

We are trying to call it from Java, using the following code:

TypeSystemDescription tsd =
> TypeSystemDescriptionFactory.createTypeSystemDescription("MainTypeSystem"
> );
> URL url = Resources.getResource("Main.ruta");
> String scriptText = Resources.toString(url, Charsets.UTF_8);
> AnalysisEngineDescription aeDes =
> Ruta.createAnalysisEngineDescription(scriptText, tsd);
> AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aeDes);


 The error we are getting:

org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator
> processing failed.
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:401)
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:309)
> at
> org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
> at org.cogroo.tools.checker.checkers.UIMAChecker.check(UIMAChecker.java:74)
> at org.cogroo.tools.checker.checkers.UIMAChecker.check(UIMAChecker.java:1)
> at
> org.cogroo.tools.checker.TypedCheckerComposite.check(TypedCheckerComposite.java:49)
> at org.cogroo.checker.GrammarChecker.analyze(GrammarChecker.java:252)
> at org.cogroo.checker.GrammarChecker.analyze(GrammarChecker.java:271)
> at org.cogroo.tools.checker.checkers.UIMAChecker.main(UIMAChecker.java:131)
> Caused by: java.lang.NullPointerException
> at
> org.apache.uima.ruta.engine.RutaEngine.resetEnvironment(RutaEngine.java:529)
> at
> org.apache.uima.ruta.engine.RutaEngine.resetEnvironments(RutaEngine.java:524)
> at org.apache.uima.ruta.engine.RutaEngine.process(RutaEngine.java:480)
> at
> org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:385)
> ... 8 more


We have a feeling that RUTA can't find the child script files, and that
causes the error. Are we missing something?


Thank you,
William


UIMA logo in SVG/PDF ?

2010-04-27 Thread William Colen
Hello,

I'm creating a poster presentation about UIMA. I could not find a nice UIMA
logo in SVG or PDF and the ones I could find in PNG or JPG looks bad if too
large. Anyone knows where to get an UIMA logo in a vector format or large
enough PNG/JPG?

Thanks
William - Brazil