private void convertSaltProject ( SaltProject p , List < String > annoKeys , Map < String , String > args , boolean alignmc , int offset , Map < String , CorpusConfig > corpusConfigs , Writer out , Integer nodeCount ) throws IOException , IllegalArgumentException { int recordNumber = offset ; if ( p != null && p . getCorpusGraphs ( ) != null ) { Map < String , String > spanAnno2order = null ; boolean virtualTokenizationFromNamespace = false ; Set < String > corpusNames = CommonHelper . getToplevelCorpusNames ( p ) ; if ( ! corpusNames . isEmpty ( ) ) { CorpusConfig config = corpusConfigs . get ( corpusNames . iterator ( ) . next ( ) ) ; if ( config != null ) { if ( "true" . equalsIgnoreCase ( config . getConfig ( "virtual_tokenization_from_namespace" ) ) ) { virtualTokenizationFromNamespace = true ; } else { String mappingRaw = config . getConfig ( "virtual_tokenization_mapping" ) ; if ( mappingRaw != null ) { spanAnno2order = new HashMap <> ( ) ; for ( String singleMapping : Splitter . on ( ' ' ) . split ( mappingRaw ) ) { List < String > mappingParts = Splitter . on ( ' ' ) . splitToList ( singleMapping ) ; if ( mappingParts . size ( ) >= 2 ) { spanAnno2order . put ( mappingParts . get ( 0 ) , mappingParts . get ( 1 ) ) ; } } } } } } for ( SCorpusGraph corpusGraph : p . getCorpusGraphs ( ) ) { if ( corpusGraph . getDocuments ( ) != null ) { for ( SDocument doc : corpusGraph . getDocuments ( ) ) { if ( virtualTokenizationFromNamespace ) { TimelineReconstructor . removeVirtualTokenizationUsingNamespace ( doc . getDocumentGraph ( ) ) ; } else if ( spanAnno2order != null ) { // there is a definition how to map the virtual tokenization to a real one TimelineReconstructor . removeVirtualTokenization ( doc . getDocumentGraph ( ) , spanAnno2order ) ; } if ( nodeCount != null ) { createAdjacencyMatrix ( doc . getDocumentGraph ( ) , args , recordNumber ++ , nodeCount ) ; } else { outputText ( doc . getDocumentGraph ( ) , alignmc , recordNumber ++ , out ) ; } } } } } }
invokes the createAdjacencyMatrix method if nodeCount ! = null or outputText otherwise