protected virtual void AddTitle(NameSymbol symbol) { // Add it to the collection Symbols.Add(symbol); if (FirstTitle == 0) { FirstTitle = Count; } if (symbol.Value.ToString() == "The") { if (Count == 2) { // Special case, we probably have <name> The <title> lastForename = Count - 1; } else { // Special case which implies the next word must be of class <Title> FirstForename = Count + 2; } } else if (symbol.Value.ToString() == "of") { var prev = Symbol(Count - 1) as NameSymbol; // Nasty as it can be part of <Title> or <Surname> if (prev != null && prev.NameType == NameToken.Title) { // Special case which implies the next work must be of class <Title> FirstForename = Count + 2; } else { // Just set the first surname position and hope something else fixes it FirstSurname = Count - 1; } } else { // Move it forwards and hope it gets resolved later FirstForename = Count + 1; } }
protected virtual void AddMultiple(NameSymbol symbol) { // NB We don't add the symbol here as we will be re-dispatching it and the target will add it if (symbol.NameType == NameToken.Multiple) { switch (symbol.Value.ToString()) { case "SC": if ((FirstForename == 0) | (FirstForename == Count)) { symbol.NameType = NameToken.Title; AddTitle(symbol); } else { symbol.NameType = NameToken.Civil; AddLetters(symbol); } break; } } }