Formatting bibliographic names in TUSTEP - bibliography

I have a large bibliography in the following forms:
Lastname, Firstname [optional Middlename]: Title
Lastname1, Firstname1 [optional Middlename1]; Lastname2, Firstname2 [optional Middlename2]: Title
I need to automatically convert this into the following form in a TUSTEP session:
Firstname [optional Middlename] LASTNAME: Title
Firstname1 [opt. Middlename1] LASTNAME1; Firstname2 [opt. Middlename2] LASTNAME2: Title
I could easily run the change on single author names with the instruction a,,,-{\A}{00}{&a}, {\A}{00}{&a}:-{+5=}{+6=} {+1=}{+2+}:-, but how can I also execute the change on bibliographic entries with multiple author names in a single pass?

a,,,-{00}{&a},{00}{!}[;:]-{+3=} {+1+}{+4=}- should do the trick.
Your instruction did not catch middlenames, that's why the {!} was used, catching any kind of ASCII-Symbol including whitespace. And [;:] means either colon or semi-colon.
By the way: Not every surname actually starts with an uppercase letter (consider de,von , vaan,t' etc.).

Related

Regex to find middle initial after first name

Language C#. In the 'Leave' event of a textbox, I'm using Regex to try to find a single Middle Initial following a FirstName and a Space. If a match is found, I then TitleCase the beginning character of the FirstName and MI and add a period "." after the middle initial. Otherwise, I just TitleCase the FirstName.
I show a section of my code below:
private void FirstName_Leave(object sender, EventArgs e)
{
//Regex looks for a single letter following first name, i.e.
//middle initial, and adds a '.' period after the letter.
Match match = Regex.Match(FirstName.Text, #"\w+\s[a-zA-Z]");
if (match.Success)
{
FirstName.Text = ReturnTitleCase(FirstName.Text + ".");
}
else
{
FirstName.Text = ReturnTitleCase(FirstName.Text);
}
}
This works fine when the end-user enters just a single character after the FirstName, i.e., Mike E.
However, if the user enters a fully spelled out middle name such as Mike Edward, then a period is entered after the middle name like 'Mike Edward.'
I've also tried other Regex syntax such as the following, from a StackOverFlow site shown below.looking for one or more characters in the FirstName, then one or more Space characters, followed by just a Single word character. However, this again adds a period "." after a spelled out middle name.
regex middle name initial with or without it there
Match match = Regex.Match(FirstName.Text, #"\w+[a-zA-Z]\s+\w?[a-zA-Z]");
Could someone suggest a Regex syntax that would check for Only a single character after the FirstName, but would ignore anything longer than just a single character middle initial?

How can I search all fields include query text partially?

I am using $text and $search to search fields including query text partially.
For example, fields is following.
{ first_name: "Frist Name", last_name: "Last Name", email:"name#email.com"}
If I type "na" in search field, I want to get all fields including "na".
How can I get fields on node.js.
To do that you want to use a regex, be aware though that this does NOT use the text index you've built.
it would look like this:
{email: new RegExp(".*na.*")}

Input a string, but the program does not recognize the spaces between words

I would like this to accept "John Smith" or "Smith, John". Currently this only accepts JohnSmith Smith,John etc. What is the issue?
while not str(NAME).isalpha():
NAME=input("Enter patient's name : ")
new_entry.append(str(NAME))
The isalpha method checks if the string is one word, e.g. no numbers and no spaces. For multiple words, you can use something like
while not all(s.isalpha() for s in NAME.replace(',', ' ').split()):
where the .replace(',', ' ') is what allows for treating spaces and commas on the same footing.

How can I formate String in java?

I have a file that contain information :
Cant Stop The Feeling! Justin Timberlake
One Dance Drake Featuring
like that separated by "\t"
my question is how I can take the first String which is here "One Dance " and put it in a String and take the Artist name "Drake Featuring "and put it in another using methods from String class .

Is there any way when I choose an option not to clear previously typed data in the input

The problem is this:
In my programme at first the user gets options for a first name - so hopefully he likes something from the options and he chooses it -so far everything is OK!
But then when he types space he starts receiving options for second name and a if he likes something and chooses it - then the Autocomplete just erases the first name. Is there any way I can change that?
hello Rich thank you very much or your response - now i've decided to change my task and here is what I made when a user types for example I character i get all the first names that start with I- so far no problem! ANd when he types the white space and K for example I make request to my web service that gets the middle names that starts with K or the last names that start with K (one of them should start with K for Iwelina), so in this case for Iwelina Ive got RADULSKA KOSEWA and KOSEWA NEDEWA! For the source of autocomplete I concatenate iwelina with (radulska kosewa)and iwelina with (KOSEWA NEDEWA) so at the end I've got IWELINA IELINA RADULSKA KOSEWA and IWELINA KOSEWA NEDEWA!!! the only problem is that when i type Iwelina K i get only IWELINA KOSEWA NEDEWA!!!here is the code for autocomlete
$('#input').autocomplete({
source: function(request, response) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term, " "));
var data = $.grep( srcAutoComp, function(value) {
return matcher.test( value.label || value.value || value );
});
response(data);
}
});
if you know how i can change it I will be glad for the help
I don't understand how, when the user begines to type the second name, he's getting results that are only the last name. For example, if he types "Joh" and selects "John" from the options, and then continues to type "John Do", then how is it possible that your drop down gives him results for only the last name, like "Doe"?
At any rate, assuming this is truly happening, you could just combine all combinations of first and last names in your source data and that will show "John Doe" in the drop down when the user types "Joh" selects "John" and then continues to type "John Do".
Another way to do this is with a complicated change to the search and response events to search after a space if it is there, and recombine it with the first string after the search for the last name is complete. If you give me your source data, I could put something together for this.

Resources