2

I've a sports application where the captain can register his team for a tournament. There can be multiple tournaments in an year and each tournament requires registration. Now, I want to support the below in registration process

  1. If a Player has already participated in the previous tournament then the app need to reuse the existing details rather forcing the registration.
  2. Need to make sure that a Player is not playing for two teams.

I am wondering how can we best implement the name match feature. It it makes any difference, most of the names are from Indian origin.

I am using Neo4j as the data store.

Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327
  • Can you give more information on how the information is stored and why using .equals() won't work? since they would have to put at least their name in, why can't you just directly compare that to what you have in the database and check for matches? – Daniel Aug 07 '13 at 15:03
  • Use java String method `equals()`. Or u can implement custom algorithm .[link](http://www-igm.univ-mlv.fr/~lecroq/string/) – Selvaraj Aug 07 '13 at 15:13
  • equals() is only for exact match. I want to account for typos, transpositions etc. – Aravind Yarram Aug 07 '13 at 15:23
  • @Pangea well you could always store all the names as lower case to deal with capitalization but are you sure you want to try and predict who the user is? It could be very frustrating for `John-Travis` to constantly be told he's `John Travis` (who in this contrived example is a totally different person. – Daniel Aug 07 '13 at 15:30
  • It is not even a lower case issue. Anyway, if someone enters "John-Travis" then the app questions if it is really "John Travis". This model works because the final decision is still left to the person registering the team. – Aravind Yarram Aug 07 '13 at 15:31

1 Answers1

0

You use db4o and use unickey feature for field name in player class.

Tornament class have a (Set) field with players name (and at least a reference indexed name, date name may also be indexed).

Then with two fields : the last tournament and the registration for the next one you have for one player only one tournament.

Using SODA query you can select player with last referenced tournament, and register the others

cl-r
  • 1,264
  • 1
  • 12
  • 26