public void CheckGazetteer(Gazetteer gazetteer, string word) { if (gazetteer.Contains(word) && GetParent().GetData().GetName().Equals("NNP")) { GetLayerInfo().SetLayerData(ViewLayerType.NER, gazetteer.GetName()); } if (word.Contains("'") && gazetteer.Contains(word.Substring(0, word.IndexOf("'"))) && GetParent().GetData().GetName().Equals("NNP")) { GetLayerInfo().SetLayerData(ViewLayerType.NER, gazetteer.GetName()); } }
/** * <summary>Binary attribute for a given word. If the word is listed in the Organization Gazetteer file, the attribute will * have the value "true", otherwise "false".</summary> * <param name="surfaceForm">Surface form of the word.</param> */ public IsOrganizationGazetteer(string surfaceForm) : base(gazetteer.Contains(surfaceForm)) { }
public void TestContains() { var gazetteer = new Gazetteer("location", "gazetteer-location.txt"); Assert.True(gazetteer.Contains("bağdat")); Assert.True(gazetteer.Contains("BAĞDAT")); Assert.True(gazetteer.Contains("belçika")); Assert.True(gazetteer.Contains("BELÇİKA")); Assert.True(gazetteer.Contains("körfez")); Assert.True(gazetteer.Contains("KÖRFEZ")); Assert.True(gazetteer.Contains("küba")); Assert.True(gazetteer.Contains("KÜBA")); Assert.True(gazetteer.Contains("varşova")); Assert.True(gazetteer.Contains("VARŞOVA")); Assert.True(gazetteer.Contains("krallık")); Assert.True(gazetteer.Contains("KRALLIK")); Assert.True(gazetteer.Contains("berlin")); Assert.True(gazetteer.Contains("BERLİN")); }
/** * <summary>Binary attribute for a given word. If the word is listed in the Person Gazetteer file, the attribute will * have the value "true", otherwise "false".</summary> * <param name="surfaceForm">Surface form of the word.</param> */ public IsPersonGazetteer(string surfaceForm) : base(gazetteer.Contains(surfaceForm)) { }