Re: Get the path
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 ANIBAarad...@gmail.com 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
Re: Get the path
Thank you guys All that was useful for me. Cheers Radwen 2009/7/22 Philip Ogren phi...@ogren.info 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 ANIBAarad...@gmail.com 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
Get the path
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 ? Rad
Re: Get the path
Radwen ANIBA 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 ? Rad The CAS can only return what somebody put in it. You're the one adding the documents. So if you also add the the path to the document (as a feature value on the document annotation, for example), you can later retrieve it. If you don't add it, nobody else will do it for you. Wherever you call setDocumentText() is a good place to also set the path to the document and whatever else you later need to know about it (mime type or what have you). --Thilo
Re: Get the path
On Tue, Jul 21, 2009 at 4:25 AM, Radwen ANIBAarad...@gmail.com 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