title: How to compare my result data to all data from firebase
body: <p>i have a result from ocr like "vegetable oil, potatoes, etc" and i also have multiple data from firebase such as vagetable oil = 'halal'. I want to compare my ocr result to knowing wheter my ocr result is halal or not based on my data inside my firebase</p>
  
  <blockquote>
    <p><a href="https://i.stack.imgur.com/QiBee.jpg" rel="nofollow noreferrer">This is the result of OCR with google vision</a></p>
    
    <p><a href="https://i.stack.imgur.com/spGVJ.jpg" rel="nofollow noreferrer">This is my data that I want to compare with the results of the OCR</a></p>
  </blockquote>
  
  <p>This is code for the result of OCR :</p>
  
  <pre><code>//get drawable bitmap buat ocr
  BitmapDrawable bitmapDrawable = (BitmapDrawable)mPreviewIv.getDrawable();
  Bitmap bitmap = bitmapDrawable.getBitmap();
  
  TextRecognizer recognizer = new TextRecognizer.Builder(getApplicationContext()).build();
  
  if (!recognizer.isOperational()){
      Toast.makeText(this, "ERROR",Toast.LENGTH_SHORT).show();
  }
  else{
      Frame frame = new Frame.Builder().setBitmap(bitmap).build();
      SparseArray&lt;TextBlock&gt; items = recognizer.detect(frame);
      StringBuilder sb = new StringBuilder();
  
  
      for ( int i = 0; i&lt;items.size(); i++){
          TextBlock myItem = items.valueAt(i);
          sb.append(myItem.getValue());
          sb.append("\n");
  
      }
      mResultEt.setText(sb.toString());
      }
  }
  </code></pre>