Speech2TextPrototype/Repositories/LookupTableRepository.cs
/// <summary>
/// Search for 2-word tokens as measures or dates
/// </summary>
/// <param name="bigrams">Array of 2-word tokens from the python script</param>
/// <returns>void - passing by erence</returns>
Search for 2-word tokens as measures or dates
Search for 2 - word tokens as measures or dates
private void BigramLookup(string[] bigrams)
        {
            foreach (string bigram in bigrams)
            {
                LookupTable bigramLookupValues = _context.lookupvalues.Where(row => row.Value == bigram).FirstOrDefault();
                if (bigramLookupValues != null)
                {
                    if (bigramLookupValues.Type == "Measure")
                    {
                        listMeasures.Add(bigramLookupValues.WhereStmt);
                        listMeasureValues.Add(bigramLookupValues.Value);
                    }
                    else if (bigramLookupValues.Type == "Date")
                    {
                        listDates.Add(bigramLookupValues.WhereStmt);
                        listDateValues.Add(bigramLookupValues.Value);
                    }
                    else 
                    {
                        string statement = bigramLookupValues.WhereStmt + " = " + "'" + bigramLookupValues.Value + "'";
                        listWhereStatements.Add(statement);
                    }
                }
            }
        }
private void BigramLookup ( string [ ] bigrams ) { foreach ( string bigram in bigrams ) { LookupTable bigramLookupValues = _context . lookupvalues . Where ( row => row . Value == bigram ) . FirstOrDefault ( ) ; if ( bigramLookupValues != null ) { if ( bigramLookupValues . Type == " " ) { listMeasures . Add ( bigramLookupValues . WhereStmt ) ; listMeasureValues . Add ( bigramLookupValues . Value ) ; } else if ( bigramLookupValues . Type == " " ) { listDates . Add ( bigramLookupValues . WhereStmt ) ; listDateValues . Add ( bigramLookupValues . Value ) ; } else { string statement = bigramLookupValues . WhereStmt + " " + " " + bigramLookupValues . Value + " " ; listWhereStatements . Add ( statement ) ; } } } }
Search for 2-word tokens as measures or dates
Search for 2 - word tokens as measures or dates
// Find Measurables // Find Dates // Find other "where" statements
passing by erence
passing by erence
bigrams
string[]
Array of 2-word tokens from the python script
Array of 2 - word tokens from the python script