Chez Moi – Anatomy of an App: Big Data, Randomization and Localization

Programming this first Hugomatica App, the team implemented basic functions that were available with the first Swift production release. Below are the geeky details.

Randomization for Interest

To create the soup menu portion of the Chez Moi App, we implemented randomization by starting with:

  • A Soup Base Array (e.g., tomato soup, corn chowder, lentil soup, etc.)
  • An Herb Array (e.g., dill, oregano, basil,etc.)
  • A Spice Array (e.g., paprika, garlic, peppercorns etc.)

Then we used Apple’s “arc4random_uniform()” function to select random picks. So the algorithm provides 10,000 soup combinations from just 70 ingredients.

Elegant Handling of Duplicate Items

Next we worked on the “sandwich” and “salad” categories. For those, we needed to select from the arrays multiple times, but without pulling duplicates. We had to ensure that a “salami sandwich on a french baguette” did not end up with “romaine” and “romaine”. So, we used the Swift “removeAtIndex” function.  Afterwards, we reset the array to put all of the elements back for the next iteration.

Note: Another option for ensuring that there were no duplicates would have been to choose a second item, determine if it was the same as the first and if so choose again. However, the removeAtIndex function is more efficient and faster.

Localization: French, Italian, German, Spanish and Slovak

Delivering an app in more languages improves the usefulness for the user.  For Chez Moi, we wanted it to be available in other languages and so we figured out the process. We exported the strings (Localizable Strings) to the standard XML Localization Interchange File Format (XLIFF).  Then we did the translations and then re-imported the XLIFF translations back into the project.

Big Data – Chez Moi Knows What You Like

Chez Moi learns what you like and creates solutions that adapt to your tastes. This part is proprietary. Download the app and see how it adapts to your tastes.

Chez Moi Icon

What’s Next for Chez Moi

A soup company needs to acquire this app.