Avoid splicing motor power cables when ever possible. Ideally, motor power cables should run continuous between the drive and motor terminals. The most common reason for splicing is to incorporate high-flex cable for continuous flexing applications.
The colors or numbers themselves are often a clue, but they alone may not provide sufficient information. There is always the trial and error method, but I do not recommend that because of the potential for destructive results. Instead, the Motor Doctors suggestion is to equip yourself with an ohmeter (don nott settle for just a continuity tester) and learn to perform a few simple tests with it.
You will need to use the ohmmeter as an ohmeter and not as a continuity checker for the next step in the procedure. You will want to use the lowest ohm scale your meter offers, as the typical winding resistance in motors such as these is less than 100 ohms. If the motor is a permanent split-capacitor motor, you are going to be looking for common and speed taps of the winding.
Shield drain wire must be spliced only to mating shield drain wires and not grounded at the junction box. Feedback shields must be passed through pin for pin. Separate junction boxes for power and feedback are required.