Skip to content

Commit ac93775

Browse files
committed
LT-21804: Improve some tonepars invoker tests
Change-Id: I7c8f2556b0506edf2a0a0b48c765183bf35bac9a
1 parent 9f8a88b commit ac93775

3 files changed

Lines changed: 3 additions & 28 deletions

File tree

Src/Utilities/pcpatrflex/DisambiguateInFLExDB/DisambiguateInFLExDBTests/TestData/KuniToneParsTestTPlex.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@
388388

389389
\lx 10648
390390
\mp Ac2
391+
\mp Ac2
391392
\g know
392393
\c W
393394
\wc root

Src/Utilities/pcpatrflex/DisambiguateInFLExDB/PCPatrInvoker.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ public PCPatrInvoker(string grammarFile, string anaFile, string rootglossState)
3939
TimeLimit = "0";
4040
}
4141

42-
[DllImport("kernel32.dll", SetLastError = true)]
43-
private static extern int GetShortPathName(
44-
string pathName,
45-
StringBuilder shortName,
46-
int cbShortName
47-
);
48-
4942
private void CreateBatchFile()
5043
{
5144
BatchFile = Path.Combine(Path.GetTempPath(), "PcPatrFLEx.bat");

Src/Utilities/pcpatrflex/ToneParsFLExDll/ToneParsInvoker.cs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,6 @@ internal static string ConvertNameToUseAnsiCharacters(string originalName)
111111
return sb.ToString();
112112
}
113113

114-
[DllImport("kernel32.dll", SetLastError = true)]
115-
private static extern int GetShortPathName(
116-
string pathName,
117-
StringBuilder shortName,
118-
int cbShortName
119-
);
120-
121114
private void CreateToneParsBatchFile()
122115
{
123116
// TonePars
@@ -159,13 +152,7 @@ private void CreateToneParsCmdFile()
159152
sbCmdFile.Append(DatabaseName);
160153
sbCmdFile.Append(kTPAdCtl);
161154
sbCmdFile.Append(Environment.NewLine);
162-
StringBuilder sbToneRuleFileShortPath = new StringBuilder(255);
163-
int i = GetShortPathName(
164-
ToneParsRuleFile + ".hvo",
165-
sbToneRuleFileShortPath,
166-
sbToneRuleFileShortPath.Capacity
167-
);
168-
sbCmdFile.Append(sbToneRuleFileShortPath.ToString());
155+
sbCmdFile.Append(ToneParsRuleFile + ".hvo");
169156
sbCmdFile.Append(Environment.NewLine);
170157
sbCmdFile.Append("ToneParscd.tab");
171158
sbCmdFile.Append(Environment.NewLine);
@@ -174,13 +161,7 @@ private void CreateToneParsCmdFile()
174161
sbCmdFile.Append(kTPLexicon);
175162
sbCmdFile.Append(Environment.NewLine);
176163
sbCmdFile.Append(Environment.NewLine);
177-
StringBuilder sbIntxCtlFileShortPath = new StringBuilder(255);
178-
i = GetShortPathName(
179-
IntxCtlFile,
180-
sbIntxCtlFileShortPath,
181-
sbIntxCtlFileShortPath.Capacity
182-
);
183-
sbCmdFile.Append(sbIntxCtlFileShortPath.ToString());
164+
sbCmdFile.Append(IntxCtlFile);
184165
sbCmdFile.Append(Environment.NewLine);
185166
sbCmdFile.Append(Environment.NewLine);
186167
File.WriteAllText(ToneParsCmdFile, sbCmdFile.ToString());

0 commit comments

Comments
 (0)