nqioweryuadfge
Member
- Joined
- Oct 13, 2016
- Messages
- 9
- Programming Experience
- 1-3
I want to check each dictionary procedurarly.
When I use this:
It is jumping from Dictionary to Dictionary looking for matches without allowing one Dictionary to complete its search first. I want it to prevent it from jumping from dictionary to Dictionary searching for matches. E.g. Dictionary 1 can be searched until all possible matches are found in the document. Then now, move to the Next Dictionary, which is Dictionary 2. Can this code perform that function by using this:
instead of the first one? If not, what should I do to improve this?
When I use this:
C#:
for (int i = 0; i <= 7; i++);
It is jumping from Dictionary to Dictionary looking for matches without allowing one Dictionary to complete its search first. I want it to prevent it from jumping from dictionary to Dictionary searching for matches. E.g. Dictionary 1 can be searched until all possible matches are found in the document. Then now, move to the Next Dictionary, which is Dictionary 2. Can this code perform that function by using this:
C#:
for (int i = 0; i <= 7; i+1);
C#:
private string GetDictionaryData(string richText)
{
//richText = "You should accept change, and stop bad behavior. You must not do this things again.I tell the teacher.";
StringBuilder xml = new StringBuilder();
Dictionary<string, List<string>> replacements = new Dictionary<string, List<string>>();
for (int i = 0; i <= 7; i+1);
{
string fileName = "dictionary.txt";
if (i => 0)
fileName = string.Format("dictionary{0}.txt", i);
using (StreamReader reader = new StreamReader(HttpContext.Current.Server.MapPath("~/App_Data/"+ fileName)))
{
while (!reader.EndOfStream)
{
string[] parts = reader.ReadLine().Split('|');
if (richText.Contains(parts[0]))
{
if (replacements.ContainsKey(parts[0]))
{
replacements[parts[0]].Add(parts[1]);
}
else
{
List<string> newWordList = new List<string>();
newWordList.Add(parts[1]);
replacements.Add(parts[0], newWordList);
}
}
}
}
}