📜 ⬆️ ⬇️

Typing the names of organizations

Any noble undertakings of the UI-designer and coder can somehow restore order in the lists of the names of organizations is broken about the mine / pastes of an illiterate user. Is it all bad and can we help them? Let's try to figure it out ...
image


There is nothing easier than to arrange cities or countries in alphabetical order, filter them by the first two letters or search by name. The visual representation always coincides with the expectation.

I always know that the city of Tyumen is located somewhere in the bottom of the list and always scrolling to the end when choosing painlessly ...
')
Unfortunately, the same cannot be done with the names of organizations. The lists themselves look disgusting, they are unpredictable, they are poorly sorted and you need maximum visual concentration to work with them.

image

Once I used “typography” in the title, it’s not a sin to find fault with the form of quotes that users usually manipulate (although here I would rather insist on uniformity).

Lists lists, we'll get to them. The root of all evil lies in the names themselves and in the skills of the user to type them.

Main problems:



The first problem can be solved only by education, for example, validate the field and warn about the preferred input format. Unfortunately, the last two cannot be solved; they are in their minds, but with all the other problems you can work.

We change the form paradigm

If your interface works with the names of organizations, then one field is clearly not enough, the minimum option is two. Printing documents is more correct with the full name, but it is better to display them in the interface or search for short ones.
image
It is also worth noting that, according to the law, a company can have up to 4 registered names: full, short and names in various translations.

At the input stage, it makes sense to disassemble the names into parts for later convenient storage. A good option is to break into the name, the form of ownership, the prefix and postfix. In the future, when displaying or printing, you can easily concatenate the resulting parts in any order. This is especially true for listings.
image

The only thing worth remembering when parsing is nested quotes. They need to be treated carefully and with the layout, be sure to hang them.

Lyrical digression

Foreign companies are reversed: Niantic, Inc .; Public Image, Ltd and no one will prevent us from registering our companies with the location of parts in this order: My company, LLC.

Perhaps it will break the accounting and tax software, but it seems to me that the time has come for something to change.

How to parse the name?

  1. Remembering that the name is usually not entered, but copied and pasted from the received company card, all extra white space characters must be removed from it.
  2. Replace all transcripts of organizational-legal forms and types of responsibility with abbreviations and put them to the end of the name.
  3. Bring quotes to a single form, remove those that frame the entire name and leave only the nested ones.


I wrote a small script ( beautyCo.js ) that performs these actions. He does not claim to be genius, but he can be useful in simple cases or become the starting point for something more.

Rake

In the process of working on the script, I encountered another problem - the Latin alternate characters .

In order to save time, users do not bother re-typing the phrases already begun in the Latin layout, they switch to Cyrillic and continue to write further:
OOO "Padyga"

In this title there are only two Cyrillic characters, and therefore the search and the analysis of the name will be difficult, although in print and on the screen everything seems fine.

I had to write a small script ( antiPE.js ), which changes the "alternate" symbols for ordinary ones. He can not recognize the language of the text, but he does not need it, because in the Russian Federation, all names of organizations must be in Russian ( according to paragraph 3 of article 1473 of the Civil Code of the Russian Federation ).

I hope my experience will help you in solving your interface tasks!

Source: https://habr.com/ru/post/304784/


All Articles