feat: 缓存文件添加隐藏属性;勘误表添加造字首选和规范术语类型;

fixed: 校对项内容定位和原始不一致导致从头搜索
This commit is contained in:
LittleBoy 2024-12-19 16:29:50 +08:00
parent bc65188c0c
commit ad0afdc54c
7 changed files with 15 additions and 2 deletions

Binary file not shown.

View File

@ -680,6 +680,8 @@ namespace AIProofread
{
Logger.Log("SaveCache " + document.fileName + " used " + document.ProofreadCachePath);
File.WriteAllText(document.ProofreadCachePath, cache);
// 对缓存文件进行隐藏
File.SetAttributes(document.ProofreadCachePath, FileAttributes.Hidden);
return BridgeResult.Success("ok");
}
catch (Exception ex)

View File

@ -12,7 +12,7 @@ namespace AIProofread
public class Config
{
public static readonly string APP_NAME = "AI校对王";
public static readonly string APP_VERSION = "2.0.3";
public static readonly string APP_VERSION = "2.0.4";
public static bool IS_WPS = false;
public static bool UpgradeForcedNotice = false;
public static readonly string APP_BASE_DIR = AppDomain.CurrentDomain.BaseDirectory;

View File

@ -391,7 +391,7 @@ namespace AIProofread
c.SentenceOffset = sentence.Start;
var offset = c.SentenceOffset;
if (c.Insert == sentence.Text)
if (c.Insert.TrimEnd() == sentence.Text.TrimEnd())
{
if (item.Tag == "i")
{
@ -405,6 +405,13 @@ namespace AIProofread
return range;
}
}
// 直接找
var range1 = document.Range(offset + item.Start, offset + item.End + 1);
//
if (range1.Text == item.Origin)
{
return range1;
}
}
catch (Exception)
{
@ -484,6 +491,7 @@ namespace AIProofread
if (start != -1)
{
var findOffset = paraRange.Start + start + (prefix != null ? prefix.Length : 0);
prevOffset = start;
var range = document.Range(findOffset, findOffset + wordEnd - wordStart + 1);
if (range.Text == item.Origin) { return range; }
}

View File

@ -16,8 +16,11 @@ namespace AIProofread
{"quoting_legal","引用法律条文时"},
{"incorrect_expression","表述有误"},
{"coinage","造字"},
{"coinage_first_choice","造字 首选" },
{"coinage_first","造字 首选" },
{"serial_number","作为标题序号时"},
{"alien","异形词"},
{"term","规范术语" },
};
}
}