Ejemplo n.º 1
0
        public RSTDocument ReadDocumentContent(string str, string name)
        {
            RSTDocument result = new RSTDocument();

            result.name = name;

            var documentxml = XElement.Parse(str);
            var tokensquery = from c in documentxml.Elements("tokens").Elements("token")
                              select c;

            foreach (var token in tokensquery)
            {
                var tk = new Common.Token();
                tk.name     = int.Parse(token.Attribute("id").Value);
                tk.word     = token.Attribute("word").Value;
                tk.lemma    = token.Attribute("lemma").Value;
                tk.eduid    = int.Parse(token.Attribute("eduidx").Value);
                tk.sentence = int.Parse(token.Attribute("sidx").Value) + 1; //here from 0 stanford from 1
                result.Tokens.Add(tk);
            }


            var treebankstr = (from c in documentxml.Elements("rstview") select c).First().Value;
            var input       = new java.io.StringReader(treebankstr);
            var treeReader  = new edu.stanford.nlp.trees.PennTreeReader(input);

            result.root = new RSTNode();
            result.root.Load(treeReader.readTree(), result.Tokens);

            return(result);
        }
Ejemplo n.º 2
0
 public Guid[] Rehit(Common.Token token, Guid[] orderIDs, string[] hitPrices, Guid[] accountIDs)
 {
     try
     {
         return(Global.StateServer.Rehit(token, orderIDs, hitPrices, accountIDs));
     }
     catch (Exception ex)
     {
         AppDebug.LogEvent("ManagerCallback.Rehit",
                           string.Format("Rehit:Error\r\n{0}", ex.ToString()), EventLogEntryType.Error);
         return(null);
     }
 }
Ejemplo n.º 3
0
 public Common.TransactionError Book(Common.Token token, Protocal.TransactionBookData tranData, bool preserveCalculation)
 {
     return(this.Call <TransactionError>(() => this.Service.Book(token, tranData, preserveCalculation)));
 }