高级操作

图纸去重

Illustrator图纸的去重分为两种情况:可编辑版的去重,和不可编辑的去重。

可编辑版的去重

直接在提取好的稿件中,使用Adtp载入项--Illustrator--提取稿调整--去除重复,可以直接在word中将重复项删除。如果需要保留完整版,请提前将word备份。

不可编辑版本去重

只要提取稿中含有不可编辑内容(左列含有图片)则应使用该方法:

在校对好的识别稿中使用Adtp载入项--Illustrator--提取稿调整--回传识别好的提取稿功能,并在弹出界面里选中包含预处理AI文件的文件夹,此时会将Word中的内容写入预处理AI文件中,如果操作正确,预处理AI文件里的不可编辑矩形框将会变成绿色。

操作完成后,再重新执行导出命令,即可导出纯文字的提取稿,使用Adtp载入项--Illustrator--提取稿调整--去除重复就完成了去重。

只要正确完成了回传识别好的提取稿功能,矩形框会变为绿色,此时可以使用纯文字格式的译文word来导入了。

操作前请注意备份,此操作会覆盖原文件

如果预处理时有未处理的重复内容,可以在回传识别好的提取稿完成后,手动复制粘贴绿色的矩形框将未处理的内容补齐,此步是为了获得完整的字数


合并提取稿和译稿

因为不可编辑的译稿word是左侧图片,右侧文字的表格形式,合并两个文稿可以方便在译文word中查找原文。

打开提取稿word,点击Adtp载入项--Illustrator--提取稿调整--导入翻译后文档,选中译文word,可以将译文导入至提取稿中。


高级语种筛选

AdtpWord 支持在导出图纸时,将可编辑的文字进行筛选

默认具有中文,英语和俄语的筛选,可以在Adtp载入项--Illustrator--文字筛选设置中设置

新建规则

工具通过正则表达式或自定义脚本来创建文字筛选规则,默认采用正则表达式方式,只有匹配的文字才会被导出

正则表达式语法可参考菜鸟教程

自定义规则

本工具支持使用C#作为脚本语言,C# 语言是一种现代、简洁、类型安全且面向对象的高级编程语言,语法优雅且易于学习,能与多种技术集成,广泛应用于 Windows 应用开发、Web 开发、游戏开发等领域。

现在开始学习C#

点击打开脚本,工具自带两个脚本,EnglishRegexScript.csRegexScript.cs,他们都处于我的文档\Adtp\Scripts文件夹下,其中,正则表达式筛选会使用RegexScript.cs,英语筛选会使用EnglishRegexScript.cs

如果要新建自己的自定义规则,需要使用支持C#的编辑器新建一个cs文件,并让您的代码类,继承IRegexWordsScript接口

C#脚本不能含有命名空间(namespace)

IRegexWordsScript接口定义如下:

csharp 复制代码
    public interface IRegexWordsScript{

        /// <summary>
        /// 正则表达式
        /// </summary>
        string RegexPattern { set; get; }

        /// <summary>
        /// 是否匹配
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        bool IsMatch(string text);
    }

附上RegexScript.csEnglishRegexScript.cs以供参考

csharp 复制代码
public class RegexScript : Adtp_WordAddIn.IRegexWordsScript
{
    public string RegexPattern { set; get; }

    public bool IsMatch(string text)
    {
        if (Regex.IsMatch(text, RegexPattern) || Path.HasExtension(text))
        {
            return true;
        }
        else
        {
            return false;
        }
    }
}
csharp 复制代码
public class EnglishRegexScript : Adtp_WordAddIn.IRegexWordsScript
{
    public string RegexPattern { set; get; }

    private string[] _ReadEnglishWords;
    private string[] ReadEnglishWords
    {

        get
        {

            if (_ReadEnglishWords != null) return _ReadEnglishWords;

            var path = AppDomain.CurrentDomain.BaseDirectory + "\\Scripts\\20000-words调序整洁版1.txt";

            if (File.Exists(path))
            {
                _ReadEnglishWords = File.ReadAllLines(path);
                return _ReadEnglishWords;
            }
            else
            {
                throw new FileNotFoundException("未找到20000-words调序整洁版1.txt");
            }
        }

    }

    public bool IsMatch(string text)
    {
        if (string.IsNullOrEmpty(text)) return false;

        var str_array = text.ToLower().Split(new Char[] { '1', '2', '3', '4', 
        '5', '6', '7', '8', '9', '0', ' ', '-', '_', '\"', '(', ')', ',', '.',
         '\r', '\n', '/', ':', '\'' }).ToList();

        if (Path.HasExtension(text) || Compare_to_Source(str_array, ReadEnglishWords))
        {
            return true;
        }
        else
        {
            return false;
        }
    }


    /// <summary>
    /// 是否出现在单词表中
    /// </summary>
    /// <param name="source"></param>
    /// <param name="target"></param>
    /// <returns></returns>
    private bool Compare_to_Source(List<string> source, string[] target)
    {
        List<string> dup_source = new List<string>(source);

        foreach (var item in source)
        {
            if (item.Length > 1)
            {
                if (item.EndsWith("ies"))
                {
                    dup_source.Add(item.Substring(0, item.Length - 3) + "y");
                }
                if (item.EndsWith("es"))
                {
                    dup_source.Add(item.Substring(0, item.Length - 2));
                }
                if (item.EndsWith("s"))
                {
                    dup_source.Add(item.Substring(0, item.Length - 1));
                }
            }
        }

        foreach (var item in dup_source)
        {
            if (!string.IsNullOrEmpty(item))
            {
                if (target.Contains(item))
                {
                    return true;
                }
            }
        }
        return false;
    }
}
上一个
不可编辑文件导入
下一个
常见错误
最近修改: 2025-04-15Powered by