我期望在C#中使用reg,以寻找术语,我想将这些术语的复数列入搜索。 例如,如果用户想要寻找管道,那么我也希望把结果归还给管道。
So I can do this...
string s ="\b" + term + "s*\b";
if (Regex.IsMatch(bigtext, s) { /* do stuff */ }
我将如何修改上述内容,以便让我在用户进入压力和仍然为管道/管道工作时作出相应的强调?
我期望在C#中使用reg,以寻找术语,我想将这些术语的复数列入搜索。 例如,如果用户想要寻找管道,那么我也希望把结果归还给管道。
So I can do this...
string s ="\b" + term + "s*\b";
if (Regex.IsMatch(bigtext, s) { /* do stuff */ }
我将如何修改上述内容,以便让我在用户进入压力和仍然为管道/管道工作时作出相应的强调?
您可以面临的问题是,有许多不正规的禁区,例如<条码>man<>/条码>、<条码>、<条码>和<条码>。 Pluralizationservice/code><><>>http://msdn.microsoft.com/en-us/library/system.data.entity. Design.pluralizationservices.pluralizationservices.plcomplicize_03.aspx> 在这里,是显示如何使用该产品的一个例子。
在你获得该词的复数之后,你可以很容易地建造一个可以搜索复数或单数词的雷管。
PluralizationService ps = PluralizationService.CreateService(CultureInfo.CurrentCulture);
string plural = ps.Pluralize(term);
string s = @"("+term+"|"+plural+")";
if (Regex.IsMatch(bigtext, s)) {
/* do stuff */
}
如果你使用Kingk服务器作为你的后台,你会利用Sperex。 我对你试图寻找的东西感到不安。 我假定,你正试图以搜索投入来创造充满活力的飞跃。 如果没有,我认为,有适当的准则。
EDIT:我的立场得到纠正,似乎有一些利克实体可以做些什么去做。
However, MSDN does have a soundex example, which for the simple tests I ran this morning seems to do fine as far as what I tested. http://msdn.microsoft.com/en-us/library/bb669073.aspx
我所作的改动不是使用ToUpper (invariant) i 。
这方面的一个例子是我所经历的情况。
List<string> animals = new List<string>();
animals.Add("dogs");
animals.Add("dog");
animals.Add("cat");
animals.Add("rabbits");
animals.Add("doggie");
string dog = "dog";
var data = from animal in animals
where animal.SoundEx() == dog.SoundEx()
select animal;
数据:狗、狗、狗
现在使用服务器,使用孔隙/自由Text/ContainsTable等,并使用Latlog(我不熟悉LQ服务器的新版本——回到2000年所使用的执行方式),你也可以把结果排在首位。
Also if you have the ability to use sql server you may want to look into this option: LINQ to SQL SOUNDEX - possible?
对多元化解决方案的关切,你必须能够利用4.Net。
还有一个可能有用的Levenshtein远程算法。
What is the use of default keyword in C#? Is it introduced in C# 3.0 ?
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...
I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...
I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association ...
How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...
Since I cannot order my dictionary, what is the best way of going about taking key value pairs and also maintaing an index?
Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...