| 网站首页 | 绿色软件 | 绿色数码 | 安全中心 | 屏保中心 | 源码中心 | 电子书库 | 教程库 | 图片库 | 资料库 | 算命 | 笑话 | 广告 | 绿站旧版 | 返回总部 | 
您现在的位置: 绿色软件站 >> 源码中心 >> BAT源码 >> 大型脚本 >> 源码信息
热点推荐
最新更新
本类热门
· IE 界面批处理通讯录
· svc2kxp深山红叶汉化版本
· 英汉互译
· 留-言-本
· 文件备份器V2.3修改版
推荐软件
其他更新
英汉互译
运行环境: Win9x/NT/2000/XP/2003 (载入中...)
文件大小: 1 K
软件类别: BAT源码
软件语言: 简体中文
软件属性:       
授权方式: 免费版
添加时间: 2008-3-21 20:12:39
软件等级: ★★★
软件绿化: 佚名
相关链接: 源码演示地址  源码注册地址
下载次数: 日: 周: 月: 总:
软件添加: 审核:lodge 录入:lodge
::软件简介::  

警告:运行BAT源码是一种危险的动作,如果你不熟悉,请不要尝试!

@echo off
:: 功能:
::
::   ① 输入英文,显示该英文条目下的所有内容;
:: 同时显示词库中存在的、词义相同或头部相同的其他单词;
::     ② 输入汉语,显示词义中包含该汉语词汇的所有英文
::
:: 词库文件的格式要求:
::
::   文件第一行内容必须为空,或者不能出现要查找内容的正文
::   一个段落块的首行必须为纯英文词汇
::   中文翻译内容紧接着另起一行(不允许出现纯字母行),可以有多行
::   翻译之下可以有举例内容
::   每个解释后面加中文半角状态下的分号和空格
::     解释内容可以在同一行,也可以在不同行
::   解释之下的举例内容尽量避免出现中文半角状态下的分号和空格连用的情况
::   每个段落块允许使用空行分隔
::
::             code by JM 2006-10-11~14    bbs.cn-dos.net

:input_var
title 英汉互译器
cls
set line=
set postil=
set postil_content=
set similar=
set input=
set /p input=请输入要查询的内容(要退出请直接回车):
if "%input%"=="" exit

ren ============== 判断输入类型 ==============
cls
echo %input%|findstr /b "[a-zA-Z]">nul && goto letters || goto not-letters

ren ============== 英译汉 ==============
:letters
title 英汉互译器-英译汉
:: 先提取匹配单词的第一条记录的行数,然后再从这行之下查找第一次出现的单词
:: 两个单词之间的内容就是英文的翻译
for /f "tokens=1* delims=:" %%i in ('findstr /nirc:"^%input%" 词库.txt') do (
    if /i "%%j"=="%input%" set line=%%i&goto word_finded
)
if "%line%"=="" goto no-item
:word_finded
echo _________________________________
echo 要查找的单词:%input%
echo.
setlocal enabledelayedexpansion
for /f "skip=%line% delims=" %%i in (词库.txt) do (
    echo %%i|findstr "^[a-zA-Z]*$">nul &&(goto no-postil)||(
        echo     %%i&if not "%%i"=="" set postil=exist
        echo %%i|findstr /c:"; ">nul &&(
            set postil_content=!postil_content!%%i
        )           
    )
)
:no-postil
if "%postil%"=="" (echo     %input% 条目下没有任何内容 & goto end)
echo _________________________________
echo 词义类似的单词:
echo.
for /f "tokens=1* delims=:" %%i in ('findstr /nr "%postil_content%" 词库.txt') do (
    if not "%%j"=="" set /a line=%%i-2&& call :check_similar
)
if "%similar%"=="" echo     暂无。
echo _________________________________
echo 头部相同的其他词汇:
echo.
set similar=
for /f "tokens=1* delims=:" %%i in ('findstr /nirc:"^%input%" 词库.txt') do (
    echo %%j|findstr "^[a-zA-Z]*">nul && (
        if not "%%j"=="%input%" set similar=exist&echo     %%j
    )
)
if "%similar%"=="" echo     暂无。
:end
echo _________________________________
echo.
pause
goto input_var

:check_similar
:: 查找词义中含有%postil_content%的所有英文词汇
for /f "skip=%line% delims=" %%i in (词库.txt) do (
    echo %%i|findstr "^[a-zA-Z]*$">nul &&(
        if not "%%i"=="%input%" (
            echo     %%i&set similar=exist&goto :eof
            ) else (goto :eof)
    )||(set /a line=%line%-1& goto check_similar)
)
goto :eof

ren ============== 汉译英 ==============
:not-letters
title 英汉互译器-汉译英
:: 先提取包含该汉语词汇的第一条记录的行数,然后再查找位于该行之上的纯字母行
:: 则第一次找到的纯字母行就是要查找的英文单词
:: 重复以上过程就可以查找到词义中包含这个汉语词汇的所有英文词汇
echo _________________________________
echo.
echo %input%:
echo.
for /f "tokens=1* delims=:" %%i in ('findstr /nrc:"%input%; " 词库.txt') do (
    if not "%%j"=="" set /a line=%%i-2&& call :check_word
)
if "%postil%"=="" goto no-item
echo _________________________________
echo.
pause
goto input_var

:check_word
:: 查找词义中含有%input%的所有英文词汇
set postil=exist
for /f "skip=%line% delims=" %%i in (词库.txt) do (
    echo %%i|findstr "^[a-zA-Z]*$">nul &&(echo     %%i&&goto :eof)||(
        set /a line=%line%-1&& goto check_word
    )
)
goto :eof

ren ============== 出错提示 ==============
:no-item
cls
echo _________________________________
echo.
echo %input%:
echo   没有找到该条目!
echo _________________________________
echo.
pause
goto input_var

-----------------------------------------------------------------

词库格式举例

(此行为顶行,不允许出现要查找内容的正文)
China
n.
中国, 瓷器

DOS
n.
磁盘操作系统

name
n.
名字, 名称, 姓名, 名誉
vt.
命名, 提名, 叫出, 指定
adj.
姓名的, 据以取名的

who
pron.
谁, 那...的(人)


@echo off
:: 功能:
::
::   ① 输入英文,显示该英文条目下的所有内容;
:: 同时显示词库中存在的、词义相同或头部相同的其他单词;
::     ② 输入汉语,显示词义中包含该汉语词汇的所有英文
::
:: 词库文件的格式要求:
::
::   文件第一行内容必须为空,或者不能出现要查找内容的正文
::   一个段落块的首行必须为纯英文词汇
::   中文翻译内容紧接着另起一行(不允许出现纯字母行),可以有多行
::   翻译之下可以有举例内容
::   每个解释后面加中文半角状态下的分号和空格
::     解释内容可以在同一行,也可以在不同行
::   解释之下的举例内容尽量避免出现中文半角状态下的分号和空格连用的情况
::   每个段落块允许使用空行分隔
::
::             code by JM 2006-10-11~14    bbs.cn-dos.net

:input_var
title 英汉互译器
cls
set line=
set postil=
set postil_content=
set similar=
set input=
set /p input=请输入要查询的内容(要退出请直接回车):
if "%input%"=="" exit

ren ============== 判断输入类型 ==============
cls
echo %input%|findstr /b "[a-zA-Z]">nul && goto letters || goto not-letters

ren ============== 英译汉 ==============
:letters
title 英汉互译器-英译汉
:: 先提取匹配单词的第一条记录的行数,然后再从这行之下查找第一次出现的单词
:: 两个单词之间的内容就是英文的翻译
for /f "tokens=1* delims=:" %%i in ('findstr /nirc:"^%input%" 词库.txt') do (
    if /i "%%j"=="%input%" set line=%%i&goto word_finded
)
if "%line%"=="" goto no-item
:word_finded
echo _________________________________
echo 要查找的单词:%input%
echo.
setlocal enabledelayedexpansion
for /f "skip=%line% delims=" %%i in (词库.txt) do (
    echo %%i|findstr "^[a-zA-Z]*$">nul &&(goto no-postil)||(
        echo     %%i&if not "%%i"=="" set postil=exist
        echo %%i|findstr /c:"; ">nul &&(
            set postil_content=!postil_content!%%i
        )           
    )
)
:no-postil
if "%postil%"=="" (echo     %input% 条目下没有任何内容 & goto end)
echo _________________________________
echo 词义类似的单词:
echo.
for /f "tokens=1* delims=:" %%i in ('findstr /nr "%postil_content%" 词库.txt') do (
    if not "%%j"=="" set /a line=%%i-2&& call :check_similar
)
if "%similar%"=="" echo     暂无。
echo _________________________________
echo 头部相同的其他词汇:
echo.
set similar=
for /f "tokens=1* delims=:" %%i in ('findstr /nirc:"^%input%" 词库.txt') do (
    echo %%j|findstr "^[a-zA-Z]*">nul && (
        if not "%%j"=="%input%" set similar=exist&echo     %%j
    )
)
if "%similar%"=="" echo     暂无。
:end
echo _________________________________
echo.
pause
goto input_var

:check_similar
:: 查找词义中含有%postil_content%的所有英文词汇
for /f "skip=%line% delims=" %%i in (词库.txt) do (
    echo %%i|findstr "^[a-zA-Z]*$">nul &&(
        if not "%%i"=="%input%" (
            echo     %%i&set similar=exist&goto :eof
            ) else (goto :eof)
    )||(set /a line=%line%-1& goto check_similar)
)
goto :eof

ren ============== 汉译英 ==============
:not-letters
title 英汉互译器-汉译英
:: 先提取包含该汉语词汇的第一条记录的行数,然后再查找位于该行之上的纯字母行
:: 则第一次找到的纯字母行就是要查找的英文单词
:: 重复以上过程就可以查找到词义中包含这个汉语词汇的所有英文词汇
echo _________________________________
echo.
echo %input%:
echo.
for /f "tokens=1* delims=:" %%i in ('findstr /nrc:"%input%; " 词库.txt') do (
    if not "%%j"=="" set /a line=%%i-2&& call :check_word
)
if "%postil%"=="" goto no-item
echo _________________________________
echo.
pause
goto input_var

:check_word
:: 查找词义中含有%input%的所有英文词汇
set postil=exist
for /f "skip=%line% delims=" %%i in (词库.txt) do (
    echo %%i|findstr "^[a-zA-Z]*$">nul &&(echo     %%i&&goto :eof)||(
        set /a line=%line%-1&& goto check_word
    )
)
goto :eof

ren ============== 出错提示 ==============
:no-item
cls
echo _________________________________
echo.
echo %input%:
echo   没有找到该条目!
echo _________________________________
echo.
pause
goto input_var

-----------------------------------------------------------------

词库格式举例

(此行为顶行,不允许出现要查找内容的正文)
China
n.
中国, 瓷器

DOS
n.
磁盘操作系统

name
n.
名字, 名称, 姓名, 名誉
vt.
命名, 提名, 叫出, 指定
adj.
姓名的, 据以取名的

who
pron.
谁, 那...的(人)

::下载地址::  
·电信服务器一  ·电信服务器二  ·网通服务器二  ·网通服务器一  
::相关软件::  
酷我音盒(自带100万首歌曲的播放器)
没有相关源码
(载入中...)
::相关教程::
::下载说明::
为了达到最快的下载速度,推荐使用网际快车下载本站软件。
如果您发现该软件不能下载,请通知管理员或点击【此处报错】,谢谢!
未经本站明确许可,任何网站不得非法盗链及抄袭本站资源;如引用页面,请注明来自本站,谢谢您的支持!
      网友评论:(评论内容只代表网友观点,与本站立场无关!) 发表评论