Skip to content

Commit

Permalink
chore: dig
Browse files Browse the repository at this point in the history
  • Loading branch information
sun128764 committed Oct 26, 2023
1 parent d6d1d75 commit 7191ee9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion AssParser/ParserBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void setup()
[Benchmark]
public void ParserBenchmarkTest()
{
Lib.AssParser.ParseAssFile(@"[Nekomoe kissaten&VCB-Studio] Cider no You ni Kotoba ga Wakiagaru [Ma10p_1080p][x265_flac].jp&sc.ass").Wait();
Lib.AssParser.ParseAssFile(@"C:\Users\sunjialin\Desktop\test.ass").Wait();
}
[Benchmark]
public void ParserBenchmarkTest2()
Expand Down
38 changes: 28 additions & 10 deletions AssParser/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using AssParser.Lib;
using BenchmarkDotNet.Running;
using System.Text;

namespace AssParser
{
Expand All @@ -8,13 +10,29 @@ static void Main(string[] args)
{
try
{
//var f = File.ReadAllLines(@"[Nekomoe kissaten&VCB-Studio] Cider no You ni Kotoba ga Wakiagaru [Ma10p_1080p][x265_flac].jp&sc.ass");
//var body = f[40..];
//var fs = new FileStream(@"C:\Users\sunjialin\Desktop\test.ass", FileMode.CreateNew);
//var writer = new StreamWriter(fs);
//foreach (var line in f)
//{
// writer.WriteLine(line);
//}
//for (int i = 0; i < 10; i++)
//{
// foreach (var item in body)
// {
// writer.WriteLine(item);
// }
//}
//fs.Close();
var assfile = Lib.AssParser.ParseAssFile(@"[Nekomoe kissaten&VCB-Studio] Cider no You ni Kotoba ga Wakiagaru [Ma10p_1080p][x265_flac].jp&sc.ass").Result;
var fonts = assfile.UsedFonts();
foreach (var font in fonts)
{
Console.WriteLine(font.FontName + "\t" + font.UsedChar);
}
var txt = assfile.ToString();
//var fonts = assfile.UsedFonts();
//foreach (var font in fonts)
//{
// Console.WriteLine(font.FontName + "\t" + font.UsedChar);
//}
//var txt = assfile.ToString();
}
catch (AggregateException ae)
{
Expand All @@ -33,10 +51,10 @@ static void Main(string[] args)
}
}
}
#if !DEBUG
var summary = BenchmarkRunner.Run<ParserBenchmark>();
#endif
Console.ReadLine();
//#if !DEBUG
// var summary = BenchmarkRunner.Run<ParserBenchmark>();
//#endif
//Console.ReadLine();
}
}
}
8 changes: 8 additions & 0 deletions AssParser/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"AssParser": {
"commandName": "Project",
"nativeDebugging": true
}
}
}

0 comments on commit 7191ee9

Please sign in to comment.