One thing that you might consider doing is putting the path information into its own view. That is, create a new view and set its document path to be the path/uri. One advantage of this is that if you have a CollectionReader that is otherwise type system agnostic you don't have to pollute it with a single type for holding this information. This may not be the UIMA way - but we felt for this piece of information that this was a reasonable thing to do. The following class facilitates this:

http://cleartk.googlecode.com/svn/trunk/doc/api/src-html/org/cleartk/util/ViewURIUtil.html

Here is our type system agnostic file system collection reader which makes use of it:

http://cleartk.googlecode.com/svn/trunk/doc/api/src-html/org/cleartk/util/FilesCollectionReader.html

Hope this helps.

Philip


Adam Lally wrote:
On Tue, Jul 21, 2009 at 4:25 AM, Radwen ANIBA<[email protected]> wrote:
Hello every one,

Well when playing a little bit with JCAS I was wondering how to get directly
the path to the document treated within AE without expressing it directly.

What I want to do is to get the path and the document name eg
/here/in/this/folder/Document.txt

Is there any extension of arg0.getDocumentText() method or something like ?


This information isn't build into the framework, but there are some
examples showing how to do it.  There's a type called
SourceDocumentInformation that is populated by the
FileSystemCollectionReader and then used in the XMI Writer CAS
Consumer (among others).

  -Adam
------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.20/2250 - Release Date: 07/20/09 06:16:00

Reply via email to