Hi,
(Excuse me if this is a duplicated post.)
I tried the following code but got error
" is over view "_InitialView" and cannot be added to indexes
associated with the different view "created".
at org.apache.uima.cas.impl.CASImpl.addFsToIndexes(CASImpl.java:3880)
at org.apache.uima.jcas.impl.JCasImpl.addFsToIndexes(JCasImpl.java:1076)
...
I checked the source code of UIMA but it seems that the removal of the
FS was not made properly.
My question is that:
1. Is it impossible to share FeatureStructures between multi-views in
a single CAS?
2. If yes, then remove a FS from a view and add it to another view is
also impossible?
Thanks!
-Yoshinobu
Inside JCasAnnotatorImplBase with the multi-view settings:
public void process(JCas aJCas) throws AnalysisEngineProcessException {
TypeSystem typeSystem = aJCas.getTypeSystem();
try {
JCas initialView = aJCas.getView("_InitialView");
JCas createdView = initialView.createView("created");
// JCas createdView = aJCas.createView("created");
FSIterator allIndexedFS =
initialView.getFSIndexRepository().getAllIndexedFS(typeSystem.getTopType());
while (allIndexedFS.hasNext()) {
TOP top = (TOP) allIndexedFS.next();
// I think it should work without removing... top.getView() may have
returned illegal handle though it should be removed from indexes
initialView.removeFsFromIndexes(top);
// top.removeFromIndexes();
createdView.addFsToIndexes(top);
}
}
} catch (CASException e) {
e.printStackTrace();
}
}
--
Yoshinobu KANO
[EMAIL PROTECTED]
Tsujii Laboratory, the University of Tokyo
http://www-tsujii.is.s.u-tokyo.ac.jp/