구두점 적용 로직 개선: ▼d/▼e 필드 세미콜론 적용 규칙 수정

This commit is contained in:
2025-08-19 22:51:02 +09:00
parent e815c02feb
commit 405c1d9c46
6 changed files with 78 additions and 5 deletions

4
unimarc/.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"dotnet.preferCSharpExtension": true,
"dotnet.defaultSolution": "unimarc.sln"
}

19
unimarc/NuGet.Config Normal file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="grapecity" value="https://nuget.grapecity.com/nuget" />
</packageSources>
<packageSourceCredentials />
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="0" />
<add key="disabled" value="False" />
</packageManagement>
</configuration>

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2025.08.14.2300")]
[assembly: AssemblyFileVersion("2025.08.14.2300")]
[assembly: AssemblyVersion("2025.08.19.2250")]
[assembly: AssemblyFileVersion("2025.08.19.2250")]

View File

@@ -0,0 +1,24 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniMarc", "UniMarc.csproj", "{4FCAFD58-3A8E-4E08-85E2-05329866193A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4FCAFD58-3A8E-4E08-85E2-05329866193A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4FCAFD58-3A8E-4E08-85E2-05329866193A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4FCAFD58-3A8E-4E08-85E2-05329866193A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4FCAFD58-3A8E-4E08-85E2-05329866193A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FA0A3E60-8B04-4285-947B-DE3CCCCDEB3B}
EndGlobalSection
EndGlobal

View File

@@ -33,6 +33,10 @@ namespace UniMarc.개발자용
var sql = $"select * from {cmbTables.Text}";
var cn = db.CreateConnection();
var da = new MySql.Data.MySqlClient.MySqlDataAdapter(sql, cn);
var cb = new MySql.Data.MySqlClient.MySqlCommandBuilder(da);
da.UpdateCommand = cb.GetUpdateCommand();
da.InsertCommand = cb.GetInsertCommand();
da.DeleteCommand = cb.GetDeleteCommand();
var cnt = da.Update(dt);
UTIL.MsgI($"P{cnt}");
cn.Dispose();

View File

@@ -591,12 +591,34 @@ namespace UniMarc.마크
//아래 1보다 작다로 인해 a가 미처리되는 현상이 있어 위에다가 붙인다 2508014
if (idx == "113" && (TMP[a].StartsWith("d") || TMP[a].StartsWith("e")))
{
// 새로운 구두점 적용 로직 (2024년 수정)
var subfieldata = TMP[a].Trim();
var endsignal = subfieldata.EndsWith("▲");
if (endsignal) subfieldata = subfieldata.Substring(0, subfieldata.Length - 1);
if (subfieldata.EndsWith(",") == false && subfieldata.EndsWith(";") == false)
// 현재 필드가 ,로 끝나지 않는 경우에만 ; 적용 검토
if (!subfieldata.EndsWith(",") && !subfieldata.EndsWith(";"))
{
// 다음 필드가 d나 e인지 확인
bool hasNextDE = false;
for (int nextIdx = a + 1; nextIdx < TMP.Count; nextIdx++)
{
if (!TMP[nextIdx].isEmpty() && (TMP[nextIdx].StartsWith("d") || TMP[nextIdx].StartsWith("e")))
{
hasNextDE = true;
break;
}
}
// 다음에 d나 e 필드가 있으면 ; 적용
if (hasNextDE)
{
subfieldata += ";";
subfieldata = subfieldata.Replace(",;", ";"); //두개붙은건 세미쿨론으로
}
}
// ,; 문자가 있다면 ;로 변경
subfieldata = subfieldata.Replace(",;", ";");
if (endsignal) subfieldata += "▲";
TMP[a] = subfieldata;
}