コード例 #1
0
ファイル: Program.cs プロジェクト: raear/html-zoning
        private static ZoneTree LoadZoneTree(string baselineDir, string pmid)
        {
            var html     = ReadFile(baselineDir, pmid, HTML_EX);
            var text     = ReadFile(baselineDir, pmid, TEXT_EX);
            var domTree  = ReadFile(baselineDir, pmid, DOMTREE_EX);
            var zoneTree = ReadFile(baselineDir, pmid, ZONETREE_EX);
            var tree     = _zoneTreeSerializer.Deserialize(html, text, domTree, zoneTree);

            return(tree);
        }
コード例 #2
0
        /// <summary>
        /// Deserializes a zone tree
        /// </summary>
        /// <param name="rootDirectory">The root directory</param>
        /// <param name="pmid">The pmid</param>
        /// <returns>
        /// the zone tree
        /// </returns>
        internal ZoneTree DeserializeZoneTree(string rootDirectory, string pmid)
        {
            var    paths        = this.ConstructFilePaths(rootDirectory, pmid);
            string documentHtml = File.ReadAllText(paths.DocumentHtmlPath);
            string documentText = File.ReadAllText(paths.DocumentTextPath);
            string docXml       = File.ReadAllText(paths.DocumentXmlPath);
            string zoneTreeXml  = File.ReadAllText(paths.ZoneTreeXmlPath);

            return(_zoneTreeSerializer.Deserialize(documentHtml, documentText, docXml, zoneTreeXml));
        }
コード例 #3
0
        public ZoneTree LoadZoneTree(string openFilepath)
        {
            ZoneTree tree  = null;
            var      paths = this.ConstructFilePaths(openFilepath);

            if (File.Exists(paths.ZoneTreeXmlPath))
            {
                var documentHtml = File.ReadAllText(paths.DocumentHtmlPath);
                var documentText = File.ReadAllText(paths.DocumentTextPath);
                var documentXml  = File.ReadAllText(paths.DocumentXmlPath);
                var zoneTreeXml  = File.ReadAllText(paths.ZoneTreeXmlPath);
                tree = _zoneTreeSerializer.Deserialize(documentHtml, documentText, documentXml, zoneTreeXml);
            }
            return(tree);
        }