//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public InsertAllArtifacts(SemanticNodes pNodes) { vNodes = pNodes; vList = new List <ArtNode>(); vSkipCount = 0; BuildArtifacts(); ResolveArtifactDuplicates(); }
//SELECT Name, Disamb, COUNT(Name) FROM Artifact GROUP BY Name, Disamb HAVING COUNT(Name) > 1 ORDER BY COUNT(Name) DESC //////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public static void InsertWordAndSynsetArtifacts(ISession pSess) { pSess.CreateSQLQuery("DELETE FROM " + typeof(Artifact).Name + " WHERE 1=1").UniqueResult(); BuildWordNet.SetDbStateBeforeBatchInsert(pSess); var nodes = new SemanticNodes(pSess); Console.WriteLine("Garbage collection..."); GC.Collect(); Console.WriteLine("Garbage collection complete"); var iaa = new InsertAllArtifacts(nodes); Console.WriteLine("Garbage collection..."); GC.Collect(); Console.WriteLine("Garbage collection complete"); iaa.Insert(pSess); BuildWordNet.SetDbStateAfterBatchInsert(pSess); }
/// <summary> /// Report a semantical error encountered during parsing of the source code. /// </summary> /// <param name="node">Parse node responsible / signaling the error.</param> /// <param name="startPosition">Source code start position.</param> /// <param name="stopPosition">source code end position.</param> /// <param name="parseErrorMessage">Parse error message because of source code semantical error.</param> /// <param name="offendingToken">Token responsible for the problem.</param> void IParseErrorSink.AddParserError(SemanticNodes.IParseNode node, SourceLocation startPosition, SourceLocation stopPosition, string parseErrorMessage, LexicalTokens.IToken offendingToken) { startPosition = this.TranslateSourcePosition(startPosition); stopPosition = this.TranslateSourcePosition(stopPosition); if (this.Processor.ErrorSink != null) this.Processor.ErrorSink.AddParserError(node, startPosition, stopPosition, parseErrorMessage, offendingToken); }