📄 dbfilehelper.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace WordNetParser.Helpers
{
internal class DbFileHelper
{
#region GetIndexForType
internal static List<string> GetIndexForType( DbPartOfSpechType type )
{
List<string> retVal = new List<string>();
if ( type == DbPartOfSpechType.All )
{
retVal.Add( GetDbIndexPath( DbPartOfSpechType.Adj ) );
retVal.Add( GetDbIndexPath( DbPartOfSpechType.Adv ) );
retVal.Add( GetDbIndexPath( DbPartOfSpechType.Noun ) );
retVal.Add( GetDbIndexPath( DbPartOfSpechType.Verb ) );
}
else
{
retVal.Add( GetDbIndexPath( type ) );
}
return retVal;
}
#endregion GetIndexForType
#region GetDBaseForType
internal static List<string> GetDBaseForType( DbPartOfSpechType type )
{
List<string> retVal = new List<string>();
if ( type == DbPartOfSpechType.All )
{
retVal.Add( GetDbDataPath( DbPartOfSpechType.Adj ) );
retVal.Add( GetDbDataPath( DbPartOfSpechType.Adv ) );
retVal.Add( GetDbDataPath( DbPartOfSpechType.Noun ) );
retVal.Add( GetDbDataPath( DbPartOfSpechType.Verb ) );
}
else
{
retVal.Add( GetDbDataPath( type ) );
}
return retVal;
}
#endregion GetDBaseForType
#region GetDbDataPath
private static string GetDbDataPath( DbPartOfSpechType type )
{
return GetDbFilePath( DbType.Data, type );
}
#endregion GetDbDataPath
#region GetDbIndexPath
private static string GetDbIndexPath( DbPartOfSpechType type )
{
return GetDbFilePath( DbType.Index, type );
}
#endregion GetDbIndexPath
#region GetDbFilePath
private static string GetDbFilePath( DbType db, DbPartOfSpechType pos )
{
string filePath = Path.Combine( AppDomain.CurrentDomain.BaseDirectory, "Dict" );
filePath = Path.Combine( filePath, string.Format( "{0}.{1}", db, pos ) );
return filePath;
}
#endregion GetDbFilePath
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -