<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
usingSystem.Xml.Linq;
usingSystem.IO;
publicpartialclassDefault8:System.Web.UI.Page
{
protectedvoidPage_Load(objectsender,EventArgse)
{
vardata=newList<WordComponents>();
(newDirectoryInfo(Server.MapPath("data"))).GetFiles("*.xml").ToList().ForEach(file=>
{
XDocumentdoc=XDocument.Load(file.FullName);
varq=fromwindoc.Descendants("entry")
selectnewWordComponents
{
Word=w.Descendants("hw").FirstOrDefault().Value.Replace("_","").Replace("^",""),
idioms=(fromiinw.Descendants("idiom")
selecti.Element("phrase").Value).ToList(),
phrases=(frompinw.Descendants("phraserec")
selectp.Element("phrase").Value).ToList(),
phrasalverbs=(frompvinw.Descendants("phrasal_verb")
selectpv.Element("phrase").Value).ToList(),
};
data.AddRange(q.ToList());
}
);
varqu=fromwindataorderbyw.runons.Count+w.phrases.Count+w.phrasalverbs.Countdescendingselectw;
qu.Take(500).ToList().ForEach(w=>Response.Write(string.Format("<strong>{0}</strong>contains{4}elements(idiomcount:{1}/phrasecount:{2}/phrasalverbcount:{3})<br/>",w.Word,w.idioms.Count,w.phrases.Count,w.phrasalverbs.Count,w.idioms.Count+w.phrases.Count+w.phrasalverbs.Count)));
}
publicclassWordComponents
{
publicstringWord{get;set;}
publicList<string>runons{get;set;}
publicList<string>idioms{get;set;}
publicList<string>phrases{get;set;}
publicList<string>phrasalverbs{get;set;}
publicWordComponents()
{
runons=newList<string>();
idioms=newList<string>();
phrases=newList<string>();
phrasalverbs=newList<string>();
}
}
}
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
usingSystem.Xml.Linq;
usingSystem.IO;
publicpartialclassDefault8:System.Web.UI.Page
{
protectedvoidPage_Load(objectsender,EventArgse)
{
vardata=newList<WordComponents>();
(newDirectoryInfo(Server.MapPath("data"))).GetFiles("*.xml").ToList().ForEach(file=>
{
XDocumentdoc=XDocument.Load(file.FullName);
varq=fromwindoc.Descendants("entry")
selectnewWordComponents
{
Word=w.Descendants("hw").FirstOrDefault().Value.Replace("_","").Replace("^",""),
idioms=(fromiinw.Descendants("idiom")
selecti.Element("phrase").Value).ToList(),
phrases=(frompinw.Descendants("phraserec")
selectp.Element("phrase").Value).ToList(),
phrasalverbs=(frompvinw.Descendants("phrasal_verb")
selectpv.Element("phrase").Value).ToList(),
};
data.AddRange(q.ToList());
}
);
varqu=fromwindataorderbyw.runons.Count+w.phrases.Count+w.phrasalverbs.Countdescendingselectw;
qu.Take(500).ToList().ForEach(w=>Response.Write(string.Format("<strong>{0}</strong>contains{4}elements(idiomcount:{1}/phrasecount:{2}/phrasalverbcount:{3})<br/>",w.Word,w.idioms.Count,w.phrases.Count,w.phrasalverbs.Count,w.idioms.Count+w.phrases.Count+w.phrasalverbs.Count)));
}
publicclassWordComponents
{
publicstringWord{get;set;}
publicList<string>runons{get;set;}
publicList<string>idioms{get;set;}
publicList<string>phrases{get;set;}
publicList<string>phrasalverbs{get;set;}
publicWordComponents()
{
runons=newList<string>();
idioms=newList<string>();
phrases=newList<string>();
phrasalverbs=newList<string>();
}
}
}
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
usingSystem.Xml.Linq;
usingSystem.IO;
usingSystem.Data;
publicpartialclassDefault7:System.Web.UI.Page
{
publicclassstat
{
publicstringName{get;set;}
publicstringValue{get;set;}
}
protectedvoidPage_Load(objectsender,EventArgse)
{
vardata=newList<stat>();
(newDirectoryInfo(Server.MapPath("data"))).GetFiles("*.xml").ToList().ForEach(file=>
{
XDocumentdoc=XDocument.Load(file.FullName);
data.AddRange((fromwindoc.Descendants("entry").Descendants()
wherew.Attribute("url")!=null
selectnewstat
{
Value=w.Attribute("url").Value,
Name=w.Name.LocalName
}).ToList());
});
(fromdindata
groupdbyd.Nameintog
selectnew{g.Key,Num=g.Count()}).ToList().ForEach(
a=>Response.WriteLine(string.Format("{0}:{1}",a.Key,a.Num)));
}
}
publicstaticclassext
{
publicstaticvoidWriteLine(thisHttpResponseresponse,objecto)
{
response.Write(o.ToString()+"<br/>");
}
}
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Web;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
usingSystem.Xml.Linq;
usingSystem.IO;
usingSystem.Data;
publicpartialclassDefault7:System.Web.UI.Page
{
publicclassstat
{
publicstringName{get;set;}
publicstringValue{get;set;}
}
protectedvoidPage_Load(objectsender,EventArgse)
{
vardata=newList<stat>();
(newDirectoryInfo(Server.MapPath("data"))).GetFiles("*.xml").ToList().ForEach(file=>
{
XDocumentdoc=XDocument.Load(file.FullName);
data.AddRange((fromwindoc.Descendants("entry").Descendants()
wherew.Attribute("url")!=null
selectnewstat
{
Value=w.Attribute("url").Value,
Name=w.Name.LocalName
}).ToList());
});
(fromdindata
groupdbyd.Nameintog
selectnew{g.Key,Num=g.Count()}).ToList().ForEach(
a=>Response.WriteLine(string.Format("{0}:{1}",a.Key,a.Num)));
}
}
publicstaticclassext
{
publicstaticvoidWriteLine(thisHttpResponseresponse,objecto)
{
response.Write(o.ToString()+"<br/>");
}
}
900

被折叠的 条评论
为什么被折叠?



