Spaces:
Configuration error
Configuration error
feat: implement sermon message processing and RAG pipeline with Streamlit dashboard and data ingestion tools
Browse filesFiles changed (21)
- .env.exampleAdded+6
- .gitignore+10-1
- .streamlit/config.tomlAdded+2
- src/app.py+228-55
- src/chunk_sermons.pyAdded+314
- src/colab_uploader.pyAdded+161
- src/evaluate_rag.pyAdded+240
- src/fix_chunks.pyAdded+59
- src/functions.jsAdded+876
- src/messagehub.jsAdded+213
- src/messages.htmlAdded+359
- src/messages_list.htmlAdded+17
- src/records.htmlAdded+391
- src/rename_files.pyAdded+1258
- src/scrape_all_pdfs.pyAdded+158
- src/scrape_everything.pyAdded+158
- src/search_chunks.ipynbAdded+211
- src/sermon_chunks.pkl+2-2
- src/streamlit_app.py+59-2
- src/test_sel.pyAdded+30
- src/upload_to_pinecone.pyAdded+144
123456LLM_PROVIDER=groqGROQ_MODEL=llama-3.3-70b-versatileGROQ_API_KEY=replace-with-your-rotated-groq-key
GOOGLE_API_KEY=replace-with-your-google-keyPINECONE_API_KEY=replace-with-your-pinecone-key29 unmodified lines303132333435364 unmodified lines4142434429 unmodified linessrc/.env# Streamlit.streamlit/# IDEs.vscode/4 unmodified linesThumbs.db# Project specificsrc/sermon_chunks.zip29 unmodified lines30313233343536374 unmodified lines42434445464748495051525329 unmodified linessrc/.env# Streamlit.streamlit/*!.streamlit/config.toml# IDEs.vscode/4 unmodified linesThumbs.db# Project specificsrc/sermons/src/sermons_all/src/sermon_chunks.pklsrc/sermon_chunks_backup.pklsrc/sermon_chunks.zipsrc/out.txtsrc/scratch_*src/artifact_test*.htmlsrc/upload_checkpoint.json
12[server]fileWatcherType = "none"8 unmodified lines910111213141516171817 unmodified lines363738394041424344454647484950515253545556575859606162636 unmodified lines70717273747513 unmodified lines899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613741 unmodified lines17918018118218318457 unmodified lines24224324424524624711 unmodified lines25926026126226326412 unmodified lines27727827928028128228328428528628720 unmodified lines3083093103113123137 unmodified lines3213223233243253263273283293303313323333343353363373383393403 unmodified lines34434534634734834935035110 unmodified lines3623633643653663673689 unmodified lines3783793803813823837 unmodified lines39139239339439539639760 unmodified lines45845946046146246346446546646746846947039 unmodified lines5105115125135145155165175185195205217 unmodified lines5295305315325335348 unmodified linesfrom functools import lru_cachefrom typing import Listfrom dotenv import load_dotenvfrom langchain_core.documents import Documentfrom langchain_core.embeddings import Embeddingsfrom langchain_google_genai import ChatGoogleGenerativeAIfrom langchain_pinecone import PineconeVectorStorefrom langchain_community.retrievers import BM25Retrieverfrom langchain.chains import RetrievalQA17 unmodified linesVECTOR_K = 8MAX_CONTEXT_DOCS = 20MIN_ENTITY_LENGTH = 4logger = logging.getLogger(__name__)UNSUPPORTED_ANSWER = "The retrieved sermon excerpts do not give enough support to answer that safely."# ===============================# CANONICAL SERIES# ===============================SEVEN_SEALS_CANON = ["63-0317E The Breach Between The Church Ages And The Seven Seals.pdf","63-0317M God Hiding Himself In Simplicity, Then Revealing Himself In The Same.pdf","63-0318 The First Seal.pdf","63-0319 The Second Seal.pdf","63-0320 The Third Seal.pdf","63-0321 The Fourth Seal.pdf","63-0322 The Fifth Seal.pdf","63-0323 The Sixth Seal.pdf","63-0324E The Seventh Seal.pdf","63-0324M Questions And Answers On The Seals.pdf",]SERIES_GROUPS = {"seven seals": SEVEN_SEALS_CANON,}SEVEN_SEALS_QUERY_HINTS = {6 unmodified lines"63-0324E": "seventh seal silence seven thunders coming of Christ end time",}ANSWER_MODE_INSTRUCTIONS = {"Strict Mode": ("Use strict grounding. If the retrieved excerpts do not directly support the answer, "13 unmodified lines# HELPERS# ===============================class GeminiEmbedding768(Embeddings):"""Google Gemini embeddings constrained to the Pinecone index dimension."""def __init__(self) -> None:self.api_key = os.getenv("GOOGLE_API_KEY")if not self.api_key:raise ValueError("GOOGLE_API_KEY is not set")def _embed(self, text: str) -> List[float]:url = ("https://generativelanguage.googleapis.com/v1beta/"f"{GEMINI_EMBEDDING_MODEL}:embedContent?key={self.api_key}")payload = {"content": {"parts": [{"text": text}]},"outputDimensionality": PINECONE_DIMENSION,}request = urllib.request.Request(url,data=json.dumps(payload).encode("utf-8"),headers={"Content-Type": "application/json"},method="POST",)try:with urllib.request.urlopen(request, timeout=30) as response:data = json.loads(response.read().decode("utf-8"))except urllib.error.HTTPError as exc:detail = exc.read().decode("utf-8", errors="replace")raise RuntimeError(f"Gemini embedding request failed: {detail}") from excreturn data["embedding"]["values"]def embed_documents(self, texts: List[str]) -> List[List[float]]:return [self._embed(text) for text in texts]def embed_query(self, text: str) -> List[float]:return self._embed(text)def normalize(text: str) -> str:return text.lower().replace("_", " ").replace("-", " ").strip()@lru_cache(maxsize=1)def load_chunks() -> List[Document]:if not os.path.exists(CHUNKS_FILE):41 unmodified linesreturn extract_date_code(source).upper() == code.upper()def source_matches_any_code(source: str, codes: set[str]) -> bool:return extract_date_code(source).upper() in codes57 unmodified linesreturn title_tokens.issubset(query_tokens)def query_entity_tokens(query: str) -> set[str]:return {token for token in tokenize_meaningful(query)11 unmodified linesreturn sorted(docs, key=score, reverse=True)# ===============================# RETRIEVER# ===============================12 unmodified lines*,run_manager: CallbackManagerForRetrieverRun = None) -> List[Document]:docs, _ = retrieve_documents_with_diagnostics(query)return docsdef retrieve_documents_with_diagnostics(query: str):started_at = time.perf_counter()query_clean = normalize(query)chunks = load_chunks()20 unmodified linesreturn Trueexplicit_sermon = extract_query_sermon_code(query)target_titles = []for key, titles in SERIES_GROUPS.items():7 unmodified linesif source_matches_code(d.metadata.get("source", ""), explicit_sermon)]if sermon_chunks:sermon_bm25 = BM25Retriever.from_documents(sermon_chunks)sermon_bm25.k = PRIORITY_Kfor d in sermon_bm25.invoke(query):add_doc(d, "priority")elif target_titles:for title in target_titles:target_code = extract_date_code(title).upper()sermon_chunks = [d for d in chunksif source_matches_code(d.metadata.get("source", ""), target_code)]if sermon_chunks:series_query = SEVEN_SEALS_QUERY_HINTS.get(target_code, query)for d in rank_by_query_terms(sermon_chunks, series_query)[:SERIES_DOCS_PER_SERMON]:add_doc(d, "priority")3 unmodified linesif sermon_title_matches(query, d.metadata.get("source", ""))]if title_chunks:for d in rank_by_query_terms(title_chunks, query)[:PRIORITY_K]:add_doc(d, "priority")for d in get_bm25_retriever().invoke(query):add_doc(d, "bm25")10 unmodified linespinecone_error = str(exc)logger.warning("Pinecone vector search failed: %s", exc)final_docs = results[:MAX_CONTEXT_DOCS]distinct_sermons = {d.metadata.get("source", "")for d in final_docs9 unmodified lines"pinecone_count": sum(1 for d in final_docs if d.metadata.get("retrieval_origin") == "pinecone"),"pinecone_status": pinecone_status,"pinecone_error": pinecone_error,}return final_docs, diagnostics7 unmodified linesrun_manager: CallbackManagerForRetrieverRun = None) -> List[Document]:docs, _ = retrieve_documents_with_diagnostics(query)return docs60 unmodified lines# ===============================# PUBLIC API# ===============================def get_rag_chain():llm = ChatGoogleGenerativeAI(model="gemini-2.5-flash",temperature=0.0,convert_system_message_to_human=True,)retriever = BranhamRetriever()chain = RetrievalQA.from_chain_type(39 unmodified linesif answer_mode not in ANSWER_MODE_INSTRUCTIONS:answer_mode = "Strict Mode"docs, diagnostics = retrieve_documents_with_diagnostics(question)llm = ChatGoogleGenerativeAI(model="gemini-2.5-flash",temperature=0.0,convert_system_message_to_human=True,)context_str = format_documents_for_context(docs)prompt_text = PROMPT_TEMPLATE.format(7 unmodified linesdiagnostics["total_latency"] = round(time.perf_counter() - total_started_at, 3)diagnostics["answer_mode"] = answer_modereturn {"answer": answer,8 unmodified lines910111213141516171819202117 unmodified lines394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251266 unmodified lines13313413513613713813914014114214314414514614714814913 unmodified lines16316416516616716816917017117217317417517617717817918018118218318418518618718818919019119241 unmodified lines23423523623723823924024124224357 unmodified lines30130230330430530630730830931031131231331411 unmodified lines32632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439512 unmodified lines40840941041141241341441541641741820 unmodified lines4394404414424434444457 unmodified lines4534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904913 unmodified lines49549649749849950050150250350450550610 unmodified lines5175185195205215225239 unmodified lines5335345355365375385395405417 unmodified lines54955055155255355455560 unmodified lines61661761861962062162262362462562662762862963063163263363463563663763863964064164264364464539 unmodified lines6856866876886896906916927 unmodified lines7007017027037047057067078 unmodified linesfrom functools import lru_cachefrom typing import Listfrom dotenv import load_dotenvfrom pinecone import Pineconefrom langchain_core.documents import Documentfrom langchain_core.embeddings import Embeddingsfrom langchain_google_genai import ChatGoogleGenerativeAIfrom langchain_groq import ChatGroqfrom langchain_community.embeddings import HuggingFaceEmbeddingsfrom langchain_pinecone import PineconeVectorStorefrom langchain_community.retrievers import BM25Retrieverfrom langchain.chains import RetrievalQA17 unmodified linesVECTOR_K = 8MAX_CONTEXT_DOCS = 20MIN_ENTITY_LENGTH = 4LLM_PROVIDER = os.getenv("LLM_PROVIDER", "groq").strip().lower()GROQ_MODEL = os.getenv("GROQ_MODEL", "llama-3.3-70b-versatile")GEMINI_MODEL = os.getenv("GEMINI_MODEL", "gemini-2.5-flash")logger = logging.getLogger(__name__)UNSUPPORTED_ANSWER = "The retrieved sermon excerpts do not give enough support to answer that safely."CONTEXT_POLICY = {"Strict Mode": {"max_docs": 8,"selection": "ranked",},"Study Mode": {"max_docs": 14,"selection": "ranked",},"Summary Mode": {"max_docs": 20,"selection": "distributed",},}# ===============================# CANONICAL SERIES# ===============================SEVEN_SEALS_CANON = ["63-0317M God Hiding Himself In Simplicity, Then Revealing Himself In The Same.pdf","63-0317E The Breach Between The Seven Church Ages And The Seven Seals.pdf","63-0318 The First Seal.pdf","63-0319 The Second Seal.pdf","63-0320 The Third Seal.pdf","63-0321 The Fourth Seal.pdf","63-0322 The Fifth Seal.pdf","63-0323 The Sixth Seal.pdf","63-0324M Questions And Answers On The Seals.pdf","63-0324E The Seventh Seal.pdf",]ADOPTION_CANON = ["60-0515E Adoption #1.pdf","60-0518 Adoption #2.pdf","60-0522M Adoption #3.pdf","60-0522E Adoption #4.pdf",]DEMONOLOGY_CANON = ["53-0608A Demonology, Physical Realm.pdf","53-0609A Demonology, Religious Realm.pdf","55-0724 Enticing Spirits.pdf",]SERIES_GROUPS = {"seven seals": SEVEN_SEALS_CANON,"adoption": ADOPTION_CANON,"demonology": DEMONOLOGY_CANON,}SEAL_SERMONS = ["63-0318 The First Seal.pdf","63-0319 The Second Seal.pdf","63-0320 The Third Seal.pdf","63-0321 The Fourth Seal.pdf","63-0322 The Fifth Seal.pdf","63-0323 The Sixth Seal.pdf","63-0324E The Seventh Seal.pdf",]SINGLE_SEAL_ALIASES = {"first seal": "63-0318 The First Seal.pdf","1st seal": "63-0318 The First Seal.pdf","second seal": "63-0319 The Second Seal.pdf","2nd seal": "63-0319 The Second Seal.pdf","third seal": "63-0320 The Third Seal.pdf","3rd seal": "63-0320 The Third Seal.pdf","fourth seal": "63-0321 The Fourth Seal.pdf","4th seal": "63-0321 The Fourth Seal.pdf","fifth seal": "63-0322 The Fifth Seal.pdf","5th seal": "63-0322 The Fifth Seal.pdf","sixth seal": "63-0323 The Sixth Seal.pdf","6th seal": "63-0323 The Sixth Seal.pdf","seventh seal": "63-0324E The Seventh Seal.pdf","7th seal": "63-0324E The Seventh Seal.pdf",}SEVEN_SEALS_QUERY_HINTS = {6 unmodified lines"63-0324E": "seventh seal silence seven thunders coming of Christ end time",}SERIES_QUERY_HINTS = {**SEVEN_SEALS_QUERY_HINTS,"60-0515E": "adoption placing sons predestination inheritance position","60-0518": "adoption sons inheritance child placing position","60-0522M": "adoption holy spirit church position sons","60-0522E": "adoption manifestation sons inheritance placing","53-0608A": "demonology physical realm spirits sickness oppression demons","53-0609A": "demonology religious realm spirits worship deception demons","55-0724": "enticing spirits deception religious spirits influence",}ANSWER_MODE_INSTRUCTIONS = {"Strict Mode": ("Use strict grounding. If the retrieved excerpts do not directly support the answer, "13 unmodified lines# HELPERS# ===============================class GeminiEmbedding768(Embeddings):"""Custom local HuggingFace BGE embedding client matched to the 768-dimension index."""def __init__(self) -> None:logger.info("Initializing local HuggingFace BGE embedding client (BAAI/bge-base-en-v1.5)...")# Load HuggingFace BGE model locally on CPU (or CUDA/MPS if available, default to CPU for general reliability)self.embeddings = HuggingFaceEmbeddings(model_name="BAAI/bge-base-en-v1.5",model_kwargs={'device': 'cpu'},encode_kwargs={'normalize_embeddings': True})logger.info("Local BGE embedding client initialized successfully!")def embed_documents(self, texts: List[str]) -> List[List[float]]:if not texts:return []return self.embeddings.embed_documents(texts)def embed_query(self, text: str) -> List[float]:return self.embeddings.embed_query(text)def normalize(text: str) -> str:return text.lower().replace("_", " ").replace("-", " ").strip()@lru_cache(maxsize=1)def load_chunks() -> List[Document]:if not os.path.exists(CHUNKS_FILE):41 unmodified linesreturn extract_date_code(source).upper() == code.upper()def source_matches_title(source: str, title: str) -> bool:return source_matches_code(source, extract_date_code(title).upper())def source_matches_any_code(source: str, codes: set[str]) -> bool:return extract_date_code(source).upper() in codes57 unmodified linesreturn title_tokens.issubset(query_tokens)def detect_single_seal_title(query: str) -> str | None:query_clean = normalize_text(query)for alias, title in SINGLE_SEAL_ALIASES.items():if alias in query_clean:return titlereturn Nonedef query_entity_tokens(query: str) -> set[str]:return {token for token in tokenize_meaningful(query)11 unmodified linesreturn sorted(docs, key=score, reverse=True)def distributed_sample(docs: List[Document], limit: int) -> List[Document]:if limit <= 0 or len(docs) <= limit:return docs[:limit]if limit == 1:return [docs[0]]step = (len(docs) - 1) / (limit - 1)selected = []used_indexes = set()for i in range(limit):index = round(i * step)if index not in used_indexes:selected.append(docs[index])used_indexes.add(index)return selecteddef select_context_docs(docs: List[Document], query: str, answer_mode: str) -> List[Document]:policy = CONTEXT_POLICY.get(answer_mode, CONTEXT_POLICY["Strict Mode"])max_docs = policy["max_docs"]if "seven seals" in normalize(query):guaranteed_titles = SEVEN_SEALS_CANON if answer_mode == "Summary Mode" else SEAL_SERMONSselected = []seen = set()for title in guaranteed_titles:code = extract_date_code(title).upper()for doc in docs:if source_matches_code(doc.metadata.get("source", ""), code):key = document_key(doc)if key not in seen:selected.append(doc)seen.add(key)breakremaining = max_docs - len(selected)if remaining > 0:for doc in docs:key = document_key(doc)if key not in seen:selected.append(doc)seen.add(key)remaining -= 1if remaining <= 0:breakreturn selected[:max_docs]if policy["selection"] == "distributed":priority_docs = [d for d in docs if d.metadata.get("retrieval_origin") == "priority"]other_docs = [d for d in docs if d.metadata.get("retrieval_origin") != "priority"]selected = distributed_sample(priority_docs, min(len(priority_docs), max_docs))remaining = max_docs - len(selected)if remaining > 0:selected.extend(rank_by_query_terms(other_docs, query)[:remaining])return selected[:max_docs]priority_docs = [d for d in docs if d.metadata.get("retrieval_origin") == "priority"]other_docs = [d for d in docs if d.metadata.get("retrieval_origin") != "priority"]selected = priority_docs[: min(len(priority_docs), max_docs)]remaining = max_docs - len(selected)if remaining > 0:selected.extend(rank_by_query_terms(other_docs, query)[:remaining])return selected[:max_docs]# ===============================# RETRIEVER# ===============================12 unmodified lines*,run_manager: CallbackManagerForRetrieverRun = None) -> List[Document]:docs, _ = retrieve_documents_with_diagnostics(query, answer_mode="Strict Mode")return docsdef retrieve_documents_with_diagnostics(query: str, answer_mode: str = "Strict Mode"):started_at = time.perf_counter()query_clean = normalize(query)chunks = load_chunks()20 unmodified linesreturn Trueexplicit_sermon = extract_query_sermon_code(query)single_seal_title = detect_single_seal_title(query)target_titles = []for key, titles in SERIES_GROUPS.items():7 unmodified linesif source_matches_code(d.metadata.get("source", ""), explicit_sermon)]if sermon_chunks:if answer_mode == "Summary Mode":for d in distributed_sample(sermon_chunks, CONTEXT_POLICY["Summary Mode"]["max_docs"]):add_doc(d, "priority")else:sermon_bm25 = BM25Retriever.from_documents(sermon_chunks)sermon_bm25.k = PRIORITY_Kfor d in sermon_bm25.invoke(query):add_doc(d, "priority")elif single_seal_title:target_code = extract_date_code(single_seal_title).upper()sermon_chunks = [d for d in chunksif source_matches_title(d.metadata.get("source", ""), title)]if sermon_chunks:seal_query = SERIES_QUERY_HINTS.get(target_code, query)for d in rank_by_query_terms(sermon_chunks, seal_query)[:PRIORITY_K]:add_doc(d, "priority")elif target_titles:if "seven seals" in query_clean and answer_mode != "Summary Mode":titles_for_retrieval = SEAL_SERMONSelse:titles_for_retrieval = target_titlesfor title in titles_for_retrieval:target_code = extract_date_code(title).upper()sermon_chunks = [d for d in chunksif source_matches_code(d.metadata.get("source", ""), target_code)]if sermon_chunks:series_query = SERIES_QUERY_HINTS.get(target_code, query)for d in rank_by_query_terms(sermon_chunks, series_query)[:SERIES_DOCS_PER_SERMON]:add_doc(d, "priority")3 unmodified linesif sermon_title_matches(query, d.metadata.get("source", ""))]if title_chunks:if answer_mode == "Summary Mode":for d in distributed_sample(title_chunks, CONTEXT_POLICY["Summary Mode"]["max_docs"]):add_doc(d, "priority")else:for d in rank_by_query_terms(title_chunks, query)[:PRIORITY_K]:add_doc(d, "priority")for d in get_bm25_retriever().invoke(query):add_doc(d, "bm25")10 unmodified linespinecone_error = str(exc)logger.warning("Pinecone vector search failed: %s", exc)final_docs = select_context_docs(results, query, answer_mode)distinct_sermons = {d.metadata.get("source", "")for d in final_docs9 unmodified lines"pinecone_count": sum(1 for d in final_docs if d.metadata.get("retrieval_origin") == "pinecone"),"pinecone_status": pinecone_status,"pinecone_error": pinecone_error,"context_policy": answer_mode,"candidate_count": len(results),"max_context_docs": CONTEXT_POLICY.get(answer_mode, CONTEXT_POLICY["Strict Mode"])["max_docs"],}return final_docs, diagnostics7 unmodified linesrun_manager: CallbackManagerForRetrieverRun = None) -> List[Document]:docs, _ = retrieve_documents_with_diagnostics(query, answer_mode="Strict Mode")return docs60 unmodified lines# ===============================# PUBLIC API# ===============================@lru_cache(maxsize=1)def get_llm():if LLM_PROVIDER == "groq":if not os.getenv("GROQ_API_KEY"):raise ValueError("GROQ_API_KEY is required when LLM_PROVIDER=groq.")return ChatGroq(model=GROQ_MODEL,temperature=0.0,)if LLM_PROVIDER == "gemini":if not os.getenv("GOOGLE_API_KEY"):raise ValueError("GOOGLE_API_KEY is required when LLM_PROVIDER=gemini.")return ChatGoogleGenerativeAI(model=GEMINI_MODEL,temperature=0.0,convert_system_message_to_human=True,)raise ValueError(f"Unsupported LLM_PROVIDER '{LLM_PROVIDER}'. Use 'groq' or 'gemini'.")def get_rag_chain():llm = get_llm()retriever = BranhamRetriever()chain = RetrievalQA.from_chain_type(39 unmodified linesif answer_mode not in ANSWER_MODE_INSTRUCTIONS:answer_mode = "Strict Mode"docs, diagnostics = retrieve_documents_with_diagnostics(question, answer_mode=answer_mode)llm = get_llm()context_str = format_documents_for_context(docs)prompt_text = PROMPT_TEMPLATE.format(7 unmodified linesdiagnostics["total_latency"] = round(time.perf_counter() - total_started_at, 3)diagnostics["answer_mode"] = answer_modediagnostics["llm_provider"] = LLM_PROVIDERdiagnostics["llm_model"] = GROQ_MODEL if LLM_PROVIDER == "groq" else GEMINI_MODELreturn {"answer": answer,
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314import osimport reimport pickleimport jsonimport tracebackimport fitzfrom langchain_core.documents import Document
FOLDER = "./sermons_all"OUTPUT_FILE = "sermon_chunks.pkl"DLQ_FILE = "chunking_dlq.json"
def clean_filename(name): name = re.sub(r'[\\/*?:"<>|]', '', name) name = re.sub(r'\s+', ' ', name).strip() return name
def extract_sermon_info(filename): name = filename.replace(".pdf", "").replace(".PDF", "") parts = name.split(" ", 1) if len(parts) == 2: date_code = parts[0] title = parts[1] else: date_code = "00-0000" title = name return date_code, title
def extract_location(first_page_text, title): # E.g. "Faith Is The SubstanceOakland, California, USA" or "Jeffersonville, Indiana, USA" lines = [line.strip() for line in first_page_text.split("\n") if line.strip()][:6] location = "Unknown" for line in lines: if "usa" in line.lower() or "u.s.a." in line.lower() or "unknown" in line.lower(): # If the line starts with the title, strip the title prefix if line.lower().startswith(title.lower()): loc_candidate = line[len(title):].strip() if loc_candidate: location = loc_candidate break # Spacing/punctuation fallback match = re.search(re.escape(title), line, re.IGNORECASE) if match: loc_candidate = line[match.end():].strip() if loc_candidate: location = loc_candidate break # On its own line location = line break location = re.sub(r'^[^\w]+', '', location).strip() return location
def clean_line(line, clean_title): cleaned = line.strip() if not cleaned: return None # Ignore page boundaries if cleaned.startswith("--- PAGE") and cleaned.endswith("---"): return None # Dynamic title header matching # Strips leading and trailing page numbers/digits to isolate the clean title alphanum_line = re.sub(r'[^a-zA-Z0-9]', '', cleaned).lower() stripped_alphanum = re.sub(r'^\d+|\d+$', '', alphanum_line) if stripped_alphanum == clean_title: return None # Ignore common sermon locations / dates at startup if cleaned in ["Jeffersonville, Indiana, USA", "Chicago, Illinois, USA", "Macon, Georgia, USA", "Spindale, North Carolina, USA"]: return None return line
def is_adjacent_to_header(lines, idx, clean_title_key): # Check previous non-empty lines for i in range(idx - 1, -1, -1): stripped = lines[i].strip() if stripped: if clean_line(stripped, clean_title_key) is None: return True break # Check next non-empty lines for i in range(idx + 1, len(lines)): stripped = lines[i].strip() if stripped: if clean_line(stripped, clean_title_key) is None: return True break return False
def parse_pdf_generator(filepath, title): """ Generator that parses a single PDF page-by-page and yields parsed paragraph dictionaries with location. """ doc = fitz.open(filepath) clean_title_key = re.sub(r'[^a-zA-Z0-9]', '', title).lower() # Extract location from first page location = "Unknown" if len(doc) > 0: first_page_text = doc[0].get_text() if first_page_text: location = extract_location(first_page_text, title) current_para_num = 1 current_para_text = [] current_para_start_page = 1 expected_para = 1 for page_idx, page in enumerate(doc): page_num = page_idx + 1 text = page.get_text() if not text: continue lines = text.split("\n") for line_idx, line in enumerate(lines): line_cleaned = clean_line(line, clean_title_key) if line_cleaned is None: continue line_stripped = line_cleaned.strip() if not line_stripped: continue # Strip standalone page number if adjacent to title header if line_stripped.isdigit() and is_adjacent_to_header(lines, line_idx, clean_title_key): continue # 1. Check if line is exactly a paragraph number if line_stripped.isdigit(): val = int(line_stripped) if expected_para <= val <= expected_para + 5: if val == 1: # Merge pre-intro text into paragraph 1 current_para_num = 1 expected_para = 2 continue # Yield previous paragraph if current_para_text: yield { "paragraph": str(current_para_num), "text": " ".join(current_para_text), "page_start": current_para_start_page, "page_end": page_num, "location": location } current_para_text = [] current_para_num = val expected_para = val + 1 current_para_start_page = page_num continue # 2. Check if line ends with a paragraph number matched_end = False for candidate in range(expected_para, expected_para + 3): pattern = rf"^(?P<text>.*?)(?<!\d){candidate}$" match = re.match(pattern, line_stripped) if match: text_before = match.group("text").strip() if text_before: current_para_text.append(text_before) # Yield previous paragraph if current_para_text: yield { "paragraph": str(current_para_num), "text": " ".join(current_para_text), "page_start": current_para_start_page, "page_end": page_num, "location": location } current_para_text = [] current_para_num = candidate expected_para = candidate + 1 current_para_start_page = page_num matched_end = True break if matched_end: continue # 3. Check if line starts with a paragraph number matched_start = False for candidate in range(expected_para, expected_para + 3): pattern = rf"^{candidate}(?!\d)\s*(?P<text>.*)$" match = re.match(pattern, line_stripped) if match: text_after = match.group("text").strip() # Yield previous paragraph if current_para_text: yield { "paragraph": str(current_para_num), "text": " ".join(current_para_text), "page_start": current_para_start_page, "page_end": page_num, "location": location } current_para_text = [] current_para_num = candidate expected_para = candidate + 1 current_para_start_page = page_num if text_after: current_para_text.append(text_after) matched_start = True break if matched_start: continue current_para_text.append(line_stripped) # Yield the final paragraph if current_para_text: yield { "paragraph": str(current_para_num), "text": " ".join(current_para_text), "page_start": current_para_start_page, "page_end": len(doc), "location": location }
def scan_all_sermons_generator(folder): """ Generator that processes all PDFs in the folder one by one. Yields tuple of (Document, None) on success, or (None, err_dict) on failure. """ files = sorted([f for f in os.listdir(folder) if f.lower().endswith(".pdf")]) print(f"Discovered {len(files)} PDFs in '{folder}' to chunk.") for filename in files: filepath = os.path.join(folder, filename) date_code, title = extract_sermon_info(filename) try: for chunk in parse_pdf_generator(filepath, title): text_clean = re.sub(r"\s+", " ", chunk["text"]).strip() doc = Document( page_content=text_clean, metadata={ "source": filename, "title": title, "date_code": date_code, "paragraph": chunk["paragraph"], "page_start": chunk["page_start"], "page_end": chunk["page_end"], "location": chunk["location"] } ) yield doc, None except Exception as e: err_info = { "filename": filename, "error": str(e), "traceback": traceback.format_exc() } yield None, err_info
def main(): if not os.path.exists(FOLDER): print(f"Error: Folder '{FOLDER}' does not exist.") return all_chunks = [] dlq_list = [] processed_count = 0 failed_count = 0 current_file = None print("\nStarting ingestion pipeline...") # Process using the generator for doc, err in scan_all_sermons_generator(FOLDER): if err: print(f" [DLQ] Failed to parse: {err['filename']} - Error: {err['error']}") dlq_list.append(err) failed_count += 1 else: all_chunks.append(doc) file_source = doc.metadata["source"] if file_source != current_file: current_file = file_source processed_count += 1 if processed_count % 50 == 0: print(f"Processed {processed_count} sermons... ({len(all_chunks)} chunks total)") # Save the Dead Letter Queue (DLQ) if any errors occurred if dlq_list: with open(DLQ_FILE, "w", encoding="utf-8") as f: json.dump(dlq_list, f, indent=2) print(f"\n[WARNING] Dead Letter Queue created with {len(dlq_list)} failures at '{DLQ_FILE}'.") else: if os.path.exists(DLQ_FILE): os.remove(DLQ_FILE) # Save output to pickle file print(f"\nIngested {processed_count} sermons with {len(all_chunks)} total chunks.") if failed_count > 0: print(f"Failed to ingest {failed_count} files (logged to DLQ).") print(f"Saving chunks to '{OUTPUT_FILE}'...") with open(OUTPUT_FILE, "wb") as f: pickle.dump(all_chunks, f) print("Ingestion complete and successfully serialized!")
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161# ==============================================================================# Google Colab High-Speed Pinecone Sermon Ingestion Script (bge-base-en-v1.5)# ==============================================================================# This script is designed to run in a Google Colab notebook with a GPU (T4 or better).# It will generate embeddings at over 500 chunks/sec, uploading your entire# sermon database (102,127 chunks) in under 5 minutes!## INSTRUCTIONS:# 1. Open Google Colab: https://colab.research.google.com/# 2. Go to: Runtime -> Change runtime type -> Select T4 GPU (or any available GPU).# 3. Copy and paste this script into a code cell in Colab.# 4. Upload your 'sermon_chunks.pkl' file to the root directory in Colab using# the file explorer sidebar.# 5. Run the code cell!# ==============================================================================
import osimport sysimport jsonimport timeimport picklefrom typing import List
# Install required dependencies inside the Colab environmentprint("Installing high-speed dependencies...")!pip install -q "numpy<2.0.0" langchain langchain-community langchain-pinecone sentence-transformers torch pinecone-client
import torchfrom langchain_core.documents import Documentfrom langchain_community.embeddings import HuggingFaceEmbeddingsfrom langchain_pinecone import PineconeVectorStorefrom pinecone import Pinecone
# --- CONFIGURATION ---INDEX_NAME = "branham-index"BATCH_SIZE = 128 # Double the batch size to maximize GPU memory throughput!CHECKPOINT_FILE = "colab_upload_checkpoint.json"
def main(): # 1. Verify GPU availability device = "cuda" if torch.cuda.is_available() else "cpu" print(f"\n[DEVICE STATUS] PyTorch is running on: {device.upper()}") if device == "cpu": print("WARNING: GPU is not active! In Colab, go to 'Runtime' -> 'Change runtime type' and select GPU for 100x speedup.") else: print("SUCCESS: T4 GPU is active and ready to accelerate embeddings!")
# 2. Verify sermon_chunks.pkl file chunks_file = "sermon_chunks.pkl" if not os.path.exists(chunks_file): print(f"\n[ERROR] '{chunks_file}' was not found in the Colab directory!") print("Please drag and drop 'sermon_chunks.pkl' from your laptop into the Colab file explorer on the left, then run this cell again.") return
print(f"\nLoading chunks from '{chunks_file}'...") with open(chunks_file, "rb") as f: chunks = pickle.load(f) total_chunks = len(chunks) print(f"Successfully loaded {total_chunks} sermon chunks.")
# 3. Prompt for Pinecone API Key pinecone_key = input("\nEnter your PINECONE_API_KEY: ").strip() if not pinecone_key: print("[ERROR] Pinecone API Key is required.") return os.environ["PINECONE_API_KEY"] = pinecone_key
# 4. Connect to Pinecone and clear index (or resume) pc = Pinecone(api_key=pinecone_key) print(f"\nConnecting to Pinecone index '{INDEX_NAME}'...") idx = pc.Index(INDEX_NAME) # Check for resume checkpoint start_idx = 0 if os.path.exists(CHECKPOINT_FILE): try: with open(CHECKPOINT_FILE, "r") as f: checkpoint = json.load(f) start_idx = checkpoint.get("last_uploaded_index", 0) print(f"[RESUME] Found checkpoint! Resuming from chunk index {start_idx}...") except Exception as e: print(f"[INFO] Failed to read checkpoint, starting from scratch: {e}")
if start_idx == 0: stats = idx.describe_index_stats() total_vectors = stats.get("total_vector_count", 0) print(f"Current total vector count: {total_vectors}") clear_choice = input("Do you want to clear the index before uploading? (y/n): ").strip().lower() if clear_choice == "y": print(f"Deleting all vectors in '{INDEX_NAME}' to start fresh...") try: idx.delete(delete_all=True) print("Index cleared successfully!") time.sleep(5) except Exception as e: print(f"Index deletion skipped/failed: {e}")
# 5. Initialize Hugging Face BGE Model on CUDA GPU print("\nInitializing Hugging Face BGE model (BAAI/bge-base-en-v1.5) on GPU...") model_start = time.perf_counter() embeddings = HuggingFaceEmbeddings( model_name="BAAI/bge-base-en-v1.5", model_kwargs={'device': device}, encode_kwargs={'normalize_embeddings': True} ) vector_store = PineconeVectorStore( index_name=INDEX_NAME, embedding=embeddings, ) print(f"Model and Vector Store initialized in {time.perf_counter() - model_start:.1f}s.")
# 6. High-Speed Upload print(f"\nStarting batch upload of {total_chunks} chunks to Pinecone...") print(f"Batch Size: {BATCH_SIZE} | GPU acceleration enabled: {device.upper()}\n") start_time = time.perf_counter() total_batches = (total_chunks + BATCH_SIZE - 1) // BATCH_SIZE for i in range(start_idx, total_chunks, BATCH_SIZE): batch = chunks[i : i + BATCH_SIZE] batch_num = (i // BATCH_SIZE) + 1 # Robust upload loop retries = 0 while retries <= 5: try: vector_store.add_documents(batch) # Progress logging elapsed = time.perf_counter() - start_time pct = (min(i + BATCH_SIZE, total_chunks) / total_chunks) * 100 rate = (i + len(batch) - start_idx) / elapsed if elapsed > 0 else 0 eta = (total_chunks - (i + len(batch))) / rate if rate > 0 else 0 print( f"[{pct:6.2f}%] Batch {batch_num}/{total_batches} uploaded successfully. " f"({min(i + BATCH_SIZE, total_chunks)}/{total_chunks}) | " f"Speed: {rate:.1f} chunks/sec | ETA: {eta/60:.1f} min" ) # Write checkpoint with open(CHECKPOINT_FILE, "w") as f: json.dump({"last_uploaded_index": i + len(batch)}, f) break except Exception as e: retries += 1 if retries > 5: print(f"\n[FATAL ERROR] Batch {batch_num} failed completely. Error: {e}") return sleep_time = 2 ** retries print(f"\n[WARNING] Error on Batch {batch_num} (Attempt {retries}/5): {e}. Retrying in {sleep_time}s...") time.sleep(sleep_time)
print("\n==============================================================================") print("🎉 UPLOAD COMPLETED SUCCESSFULLY! 🎉") print(f"Uploaded {total_chunks} chunks to Pinecone in {time.perf_counter() - start_time:.1f}s.") print("==============================================================================")
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240import osimport sysimport jsonimport timeimport urllib.requestimport urllib.errorfrom typing import List, Dict
# Reconfigure stdout for UTF-8 to support Windows console emoji printingif sys.platform.startswith("win"): import io sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
# Add the current directory to sys.path so we can import from appsys.path.append(os.path.dirname(os.path.abspath(__file__)))
try: from app import answer_question, search_archivesexcept ImportError as e: print(f"Error importing app backend: {e}") sys.exit(1)
# ==============================================================================# GOLDEN EVALUATION DATASET# ==============================================================================# A representative set of critical doctrinal questions to run automated metrics on.GOLDEN_DATASET = [ { "query": "what are the seven seals?", "expected_topics": ["mysteries of God", "Lamb opening the seals", "white horse", "red horse"] }, { "query": "what are the seven thunders?", "expected_topics": ["mysteries", "unwritten", "seventh seal", "revelation"] }, { "query": "What is the relationship between the Serpent's Seed and Cain?", "expected_topics": ["serpent seed", "Eve", "Cain", "lineage", "Satan"] }, { "query": "Summarize the seven church ages.", "expected_topics": ["Ephesus", "Smyrna", "Pergamos", "Thyatira", "Sardis", "Philadelphia", "Laodicea"] }]
# ==============================================================================# LLM-AS-A-JUDGE METRIC EVALUATORS# ==============================================================================def call_gemini_judge(prompt: str) -> str: """Helper to query the Gemini API to act as an objective evaluation judge with automatic retry backoff.""" api_key = os.getenv("GOOGLE_API_KEY") if not api_key: return "ERROR: GOOGLE_API_KEY not set." url = f"https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key={api_key}" headers = {"Content-Type": "application/json"} payload = { "contents": [{"parts": [{"text": prompt}]}], "generationConfig": {"temperature": 0.0} # Temp 0.0 for deterministic evaluation scoring! } max_retries = 5 backoff = 10.0 for attempt in range(max_retries): req = urllib.request.Request( url, data=json.dumps(payload).encode("utf-8"), headers=headers, method="POST" ) try: with urllib.request.urlopen(req) as response: res = json.loads(response.read().decode("utf-8")) return res["candidates"][0]["content"]["parts"][0]["text"].strip() except urllib.error.HTTPError as e: if e.code == 429: print(f" [RATE LIMIT 429] Judge hit Gemini rate limits. Retrying in {backoff}s (Attempt {attempt+1}/{max_retries})...") time.sleep(backoff) backoff *= 2.0 else: return f"ERROR: judge API call failed with HTTP {e.code}: {e.reason}" except Exception as e: return f"ERROR: judge API call failed: {e}" return "ERROR: Exceeded maximum API retry limit due to continuous 429 Rate Limits."
def evaluate_faithfulness(answer: str, retrieved_contexts: List[str]) -> float: """Evaluates Groundedness/Faithfulness: Is the answer supported *only* by the context?""" context_text = "\n---\n".join(retrieved_contexts) prompt = f"""You are an expert AI system evaluation judge. Your task is to score the FAITHFULNESS (groundedness) of a generated answer based ONLY on the provided retrieved context paragraphs.
RETRIVED CONTEXT:{context_text}
GENERATED ANSWER:{answer}
INSTRUCTIONS:- Analyze the generated answer. Identify every factual claim made in it.- Check if each claim is directly supported by the retrieved context.- Rate the FAITHFULNESS on a scale of 0.0 to 1.0: * 1.0: All claims in the answer are fully grounded and supported by the context. * 0.7 - 0.9: Most claims are supported, but there are minor ungrounded additions or extensions. * 0.4 - 0.6: Significant claims in the answer are not found in the context (hallucinations). * 0.0 - 0.3: The answer has no grounding in the context or directly contradicts it.
Respond with EXACTLY a single floating-point number representing the score. Do not write any other text or reasoning.""" result = call_gemini_judge(prompt) try: return float(result.strip()) except ValueError: # Fallback parsing for token in result.split(): try: return float(token) except ValueError: continue return 0.5
def evaluate_answer_relevance(query: str, answer: str) -> float: """Evaluates Answer Relevance: Does the generated answer address the user query?""" prompt = f"""You are an expert AI system evaluation judge. Your task is to score the ANSWER RELEVANCE of a generated response based on the user's initial query.
USER QUERY:{query}
GENERATED ANSWER:{answer}
INSTRUCTIONS:- Score how directly the answer addresses the user query.- Rate the RELEVANCE on a scale of 0.0 to 1.0: * 1.0: The answer directly, fully, and clearly answers the user query. * 0.7 - 0.9: The answer addresses the query, but misses a small aspect or includes unnecessary extra details. * 0.4 - 0.6: The answer is partially relevant but misses the core question or is vague. * 0.0 - 0.3: The answer is completely off-topic or fails to address the question.
Respond with EXACTLY a single floating-point number representing the score. Do not write any other text or reasoning.""" result = call_gemini_judge(prompt) try: return float(result.strip()) except ValueError: for token in result.split(): try: return float(token) except ValueError: continue return 0.5
def evaluate_context_recall(expected_topics: List[str], retrieved_contexts: List[str]) -> float: """Evaluates Context Recall: Did retrieval capture the key doctrinal topics expected?""" context_merged = " ".join(retrieved_contexts).lower() hits = 0 for topic in expected_topics: if topic.lower() in context_merged: hits += 1 return hits / len(expected_topics) if expected_topics else 1.0
# ==============================================================================# MAIN RUNNER# ==============================================================================def main(): print("=" * 80) print("🚀 STARTING AUTOMATED RAG EVALUATION SUITE FOR THE 7TH HANDLE") print(f"Dataset Size: {len(GOLDEN_DATASET)} golden doctrinal test queries") print("=" * 80) results = [] for idx, item in enumerate(GOLDEN_DATASET, 1): query = item["query"] expected_topics = item["expected_topics"] print(f"\n[{idx}/{len(GOLDEN_DATASET)}] Evaluating Query: '{query}'...") # 1. Run RAG Pipeline start_time = time.perf_counter() response = answer_question(query, answer_mode="Strict Mode") latency = time.perf_counter() - start_time answer = response.get("answer", "") sources = response.get("source_documents", []) contexts = [doc.page_content for doc in sources] # 2. Run Evaluators faithfulness = evaluate_faithfulness(answer, contexts) relevance = evaluate_answer_relevance(query, answer) recall = evaluate_context_recall(expected_topics, contexts) print(f" -> Latency: {latency:.2f}s | Source Count: {len(sources)}") print(f" -> Faithfulness (Groundedness): {faithfulness:.2f}") print(f" -> Answer Relevance: {relevance:.2f}") print(f" -> Context Recall: {recall:.2f}") results.append({ "query": query, "latency": latency, "faithfulness": faithfulness, "relevance": relevance, "recall": recall }) # Rate limit safety sleep time.sleep(1.0) # ============================================================================== # RENDER REPORT TABLE # ============================================================================== print("\n" + "=" * 80) print("📊 FINAL RAG EVALUATION METRICS REPORT") print("=" * 80) print(f"{'Query':<45} | {'Latency':<7} | {'Faithful':<8} | {'Relevance':<9} | {'Recall':<6}") print("-" * 80) avg_latency = 0.0 avg_faithfulness = 0.0 avg_relevance = 0.0 avg_recall = 0.0 for res in results: q_short = res["query"] if len(res["query"]) <= 45 else res["query"][:42] + "..." print(f"{q_short:<45} | {res['latency']:5.2f}s | {res['faithfulness']:8.2f} | {res['relevance']:9.2f} | {res['recall']:6.2f}") avg_latency += res["latency"] avg_faithfulness += res["faithfulness"] avg_relevance += res["relevance"] avg_recall += res["recall"] n = len(results) print("-" * 80) print(f"{'OVERALL AVERAGE':<45} | {avg_latency/n:5.2f}s | {avg_faithfulness/n:8.2f} | {avg_relevance/n:9.2f} | {avg_recall/n:6.2f}") print("=" * 80) print("🎉 Evaluation suite execution completed successfully!")
if __name__ == "__main__": main()1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859import pickleimport os
# PathsCHUNKS_FILE = "sermon_chunks.pkl"BACKUP_FILE = "sermon_chunks_backup.pkl"
def extract_date_code(filename: str) -> str: """Extracts date code from source, e.g., '55-0123A The Approach To God.pdf' -> '55-0123A'""" if not filename: return "" return filename.split()[0].replace(".pdf", "")
print("Loading chunks...")with open(CHUNKS_FILE, "rb") as f: chunks = pickle.load(f)
# Save backup firstif not os.path.exists(BACKUP_FILE): print(f"Creating backup at {BACKUP_FILE}...") with open(BACKUP_FILE, "wb") as f: pickle.dump(chunks, f)
fixed_count = 0for chunk in chunks: meta = chunk.metadata if not meta: continue source = meta.get("source", "") current_date_code = meta.get("date_code", "") current_chunk_id = meta.get("chunk_id", "") # Check if we can derive a better date_code from the source correct_date_code = extract_date_code(source) # If the current date code is wrong (e.g. '00-0000' or doesn't match the source exactly) if correct_date_code and current_date_code != correct_date_code: # We need to fix it! old_date_code = current_date_code meta["date_code"] = correct_date_code # We also need to fix the chunk_id. Usually formatted like: "00-0000|p74|part1-1|pg11-11" if current_chunk_id.startswith(old_date_code + "|"): meta["chunk_id"] = current_chunk_id.replace(old_date_code + "|", correct_date_code + "|", 1) elif old_date_code == "00-0000" and "00-0000|" in current_chunk_id: meta["chunk_id"] = current_chunk_id.replace("00-0000|", correct_date_code + "|", 1) fixed_count += 1
print(f"Identified and fixed {fixed_count} chunks with incorrect date_codes.")
if fixed_count > 0: print("Saving corrected chunks back to file...") with open(CHUNKS_FILE, "wb") as f: pickle.dump(chunks, f) print("Done! The .pkl file has been updated.")else: print("No chunks needed fixing.")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876var selectedRow = null;
var curId = 0;
var curXmlRequest = null;
if (typeof xmlrequest == "undefined") var xmlrequest = new Object();
xmlrequest.AjaxRequest = function(uri, container, callback)
{
this.uri = uri;
this.container = container;
this.callback = callback;
this.cancelled = false;
this.xmlHttp = null;
try
{
// Firefox, Opera 8.0+, Safari
this.xmlHttp = new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
this.xmlHttp = null;
}
}
}
var readyStateProcess = this.processXml;
var ajaxObj = this;
this.xmlHttp.onreadystatechange = function()
{
readyStateProcess(ajaxObj);
};
}
xmlrequest.AjaxRequest.prototype = {
cancel: function()
{
this.cancelled = true;
},
isCancelled: function()
{
return this.cancelled;
},
getXmlHttp: function()
{
return this.xmlHttp;
},
doGet: function()
{
this.xmlHttp.open("GET", this.uri, true);
this.xmlHttp.send(null);
},
doPost: function(params)
{
try
{
this.xmlHttp.open("POST", this.uri, true);
this.xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
this.xmlHttp.setRequestHeader("Content-Length", params.length);
this.xmlHttp.setRequestHeader("Connection", "close");
this.xmlHttp.send(params);
}
catch(e)
{
alert(e);
}
},
processXml: function(ajaxReqObj)
{
if (ajaxReqObj.xmlHttp.readyState == 4)
{
if (ajaxReqObj.xmlHttp.status == 200)
{
if (! ajaxReqObj.isCancelled())
{
var html = ajaxReqObj.xmlHttp.responseText;
updateLoginStatus(ajaxReqObj.xmlHttp);
if (ajaxReqObj.callback != null)
{
ajaxReqObj.callback(ajaxReqObj.uri, ajaxReqObj.container, html);
}
else
{
alert(html);
}
}
}
else
{
alert("Error loading content (" + ajaxReqObj.xmlHttp.status + "). Refresh your browser and try again.");
}
}
}
}
function loadContainer(uri, container, callback, displayStatus)
{
if (curXmlRequest != null)
{
curXmlRequest.cancel();
}
if (callback == null)
{
callback = onLoadContainer;
}
var xmlRequest = curXmlRequest = new xmlrequest.AjaxRequest(uri, container, callback);
var xmlHttp = xmlRequest.getXmlHttp();
if (xmlHttp == null)
{
return;
}
if (displayStatus == null || displayStatus)
{
showLoading(container);
}
xmlRequest.doGet(uri);
}
function onLoadContainer(uri, container, html)
{
container.innerHTML = html;
checkJsCommand(html, container);
analytics.load(uri);
}
function onSubmitForm(element, container)
{
if (container == null)
{
container = getLeftContainer();
}
return submitForm(element, container, onLoadContainer);
}
function submitForm(element, container, callback, displayStatus)
{
var theForm = element;
while (theForm != null && theForm.tagName != "FORM")
{
theForm = theForm.parentNode;
}
if (theForm == null)
{
return false;
}
var params = "";
var input;
for (var i = 0; i < theForm.length; i++)
{
if (i > 0)
{
params += "&";
}
input = theForm.elements[i];
if (input.type == "checkbox")
{
if (input.checked)
{
params += input.name + "=" + encodeURIComponent(input.value);
}
}
else
{
params += input.name + "=" + encodeURIComponent(input.value);
}
}
params += "&" + element.name + ".x=0";
if (curXmlRequest != null)
{
curXmlRequest.cancel();
}
var xmlRequest = curXmlRequest = new xmlrequest.AjaxRequest(theForm.action, container, callback);
var xmlHttp = xmlRequest.getXmlHttp();
if (xmlHttp == null)
{
return false;
}
selectedRow = null;
curId = 0;
if (displayStatus == null || displayStatus)
{
showLoading(container);
}
xmlRequest.doPost(params);
return false;
}
function displayHtmlPopup(uri)
{
var ajaxRequest = new xmlrequest.AjaxRequest(uri, null, function(a, b, html)
{
grayPopup(true, html);
});
ajaxRequest.doGet();
}
function openPopup(url, name, w, h)
{
window.open(url, name, 'width=' + w + ', height=' + h +
'location=no, menubar=no, status=yes, toolbar=no, scrollbars=yes, resizable=no, directories=no');
}
function openWindow(url, name, w, h)
{
if (name == null)
{
name = "";
}
var props = "location=yes, menubar=yes, status=yes, toolbar=yes, scrollbars=yes, resizable=yes, directories=yes";
if (w != null)
{
props += ",width=" + w;
}
if (h != null)
{
props += ",height=" + h;
}
window.open(url, name, props);
}
function onSelectContent(url)
{
loadLeftContainer(url);
}
function checkJsCommand(html, container)
{
if (html.indexOf("jsCommand") == -1)
{
return;
}
var script = "";
var js = document.getElementById("jsCommand");
if (js != null)
{
script = js.innerHTML;
html = html.replace("jsCommand", "");
container.innerHTML = html;
eval(script);
}
}
function getRightContainer()
{
return getContainer("rightContent");
}
function getFormContainer()
{
return getContainer("formContainer");
}
function getLeftContainer()
{
return getContainer("leftContainer");
}
function getContainer(id)
{
return document.getElementById(id)
}
function loadFormContainer(uri, displayStatus, callback)
{
var leftContent = getLeftContainer();
leftContent.style.display = "none";
var formContent = getFormContainer();
loadContainer(uri, formContent, callback, displayStatus);
formContent.style.display = "block";
}
function hideFormContainer()
{
var formContent = getFormContainer();
formContent.style.display = "none";
var leftContent = getLeftContainer();
leftContent.style.display = "block";
}
function loadLeftContainer(uri, displayStatus, callback)
{
callback = (callback == null ? onLoadContainer : callback);
hideFormContainer();
loadContainer(uri, getLeftContainer(), callback, displayStatus);
}
function loadRightContainer(uri)
{
loadContainer(uri, getRightContainer(), onLoadContainer);
}
function showLoading(container)
{
container.innerHTML = "<div style=\"padding:10px;\">" +
"<img src=\"/images/loader.gif\" height=\"32\" width=\"32\">" +
"</div>";
}
function removeTableRow(tableRow)
{
var rowIndex = tableRow.rowIndex;
var element = tableRow;
while (element != null && element.tagName != "TABLE")
{
element = element.parentNode;
}
if (element != null)
{
element.deleteRow(rowIndex);
}
}
//function recordRemovedEvent()
//{
// mainToolbar.removeSelectedRecord();
// hideFormContainer();
//}
//
//
function onSortRecords(columnIndex)
{
var columnField = document.getElementsByName("sortColumn")[0];
var oldIndex = columnField.value;
columnField.value = columnIndex;
var sortField = document.getElementsByName("sortDirection")[0];
if (oldIndex == "" || oldIndex != columnIndex)
{
sortField.value = 1;
}
else
{
if (sortField.value < 0)
{
columnField.value = "";
sortField.value = "";
}
else
{
sortField.value = -1;
}
// sortField.value = (sortField.value < 0) ? 1 : -1;
}
gotoPage(1);
}
function gotoPage(pageNumber)
{
var field = document.getElementsByName("page")[0];
field.value = pageNumber;
loadListRecords(true);
}
function selectRecord(tableRow, id)
{
if (selectedRow != null)
{
selectedOff(selectedRow);
}
selectedOn(tableRow);
selectedRow = tableRow;
curId = id;
}
function hiOn(row)
{
if (! hasStyleClass(row, 'selected'))
{
addStyleClass(row, 'highlight');
}
}
function hiOff(row)
{
if (! hasStyleClass(row, 'selected'))
{
delStyleClass(row, 'highlight');
}
}
function selectedOn(row)
{
delStyleClass(row, 'highlight');
if (! hasStyleClass(row, 'selected'))
{
addStyleClass(row, 'selected');
}
}
function selectedOff(row)
{
delStyleClass(row, 'selected');
delStyleClass(row, 'highlight');
}
function hasStyleClass(elem, clazzName)
{
var n = ' ' + elem.className + ' ';
return (n.indexOf(' ' + clazzName + ' ') >= 0);
}
function addStyleClass(elem, clazzName)
{
var n = ' ' + elem.className + ' ';
if (n.indexOf(' ' + clazzName + ' ') < 0)
{
elem.className += (elem.className && elem.className.length > 0) ? ' ' + clazzName : clazzName;
}
}
function delStyleClass(elem, clazzName)
{
var n = ' ' + elem.className + ' ';
var len = clazzName.length;
var start = n.indexOf(' ' + clazzName + ' ');
if (start >= 0)
{
var end = start + len + 1;
elem.className = n.substring(0, start) + n.substring(end, n.length);
}
}
function appendRedirectUrls(pageUrl, srcUrl, destUrl)
{
if (srcUrl != null)
{
pageUrl = appendParameter(pageUrl, "srcUrl", srcUrl);
}
if (destUrl != null)
{
pageUrl = appendParameter(pageUrl, "destUrl", destUrl);
}
return pageUrl;
}
function appendParameter(url, parameterName, value)
{
if (parameterName == null || parameterName == "")
{
return url;
}
url += (url.indexOf("?") == -1) ? "?" : "&";
url += parameterName + "=" + value;
return url;
}
function mailto(mailbox)
{
window.location = "mailto:" + mailbox + "@bibleway.org";
}
// Changing style sheets
//function setActiveStyleSheet(title)
//{
// var i, a, main;
// for (i = 0; (a = document.getElementsByTagName("link")[i]); i++)
// {
// if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title"))
// {
// a.disabled = true;
// if (a.getAttribute("title") == title) a.disabled = false;
// }
// }
//}
//
//function getActiveStyleSheet()
//{
// var i, a;
// for (i = 0; (a = document.getElementsByTagName("link")[i]); i++)
// {
// if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
// }
// return null;
//}
//
//function getPreferredStyleSheet()
//{
// var i, a;
// for (i = 0; (a = document.getElementsByTagName("link")[i]); i++)
// {
// if (a.getAttribute("rel").indexOf("style") != -1
// && a.getAttribute("rel").indexOf("alt") == -1
// && a.getAttribute("title")
// ) return a.getAttribute("title");
// }
// return null;
//}
//
//function createCookie(name, value, days)
//{
// if (days)
// {
// var date = new Date();
// date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
// var expires = "; expires=" + date.toGMTString();
// }
// else expires = "";
// document.cookie = name + "=" + value + expires + "; path=/";
//}
//
//function readCookie(name)
//{
// var nameEQ = name + "=";
// var ca = document.cookie.split(';');
// for (var i = 0; i < ca.length; i++)
// {
// var c = ca[i];
// while (c.charAt(0) == ' ') c = c.substring(1, c.length);
// if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
// }
// return null;
//}
//
//window.onload = function(e)
//{
// var cookie = readCookie("style");
// var title = cookie ? cookie : getPreferredStyleSheet();
// setActiveStyleSheet(title);
//}
//
//window.onunload = function(e)
//{
// var title = getActiveStyleSheet();
// createCookie("style", title, 365);
//}
//var cookie = readCookie("style");
//var title = cookie ? cookie : getPreferredStyleSheet();
//setActiveStyleSheet(title);
var analytics =
{
load: function(uri)
{
if (analytics.isTrackingPage(uri))
{
try
{
pageTracker = _gat._getTracker(analytics.getTrackingNumber());
pageTracker._initData();
pageTracker._trackPageview(uri);
}
catch(err)
{
// Catch error in case _gat is undefined
}
}
},
isTrackingPage: function(uri)
{
return uri.indexOf("/admin/") == -1;
},
getHostName: function()
{
return window.location.hostname.toLowerCase();
},
getTrackingNumber: function()
{
var hostName = analytics.getHostName();
switch (hostName)
{
case "www.biblebelievers.org":
case "biblebelievers.org":
return "UA-4538981-1";
case "www.bibleway.org":
case "bibleway.org":
return "UA-4538981-2";
// case "preview.bibleway.org":
// return "UA-4538981-3";
default:
return "";
}
}
}
function grayPopup(vis, html){
grayOut(vis);
displayHtml(vis, html);
}
function grayOut(vis) {
var dark=document.getElementById('darkScreen');
if (!dark) {
dark = document.createElement('div');
dark.style.position = "absolute";
dark.style.top = "0px";
dark.style.left = "0px";
dark.style.overflow = "hidden";
dark.style.display = "none";
dark.id = "darkScreen";
document.getElementsByTagName("body")[0].appendChild(dark);
}
// hideDropDowns(vis);
if (vis) {
setOpacity(dark, 0.8);
dark.style.zIndex = 50;
dark.style.backgroundColor = "#000000";
dark.style.width = getFullWidth() + "px";
dark.style.height = getScreenHeight() + "px";
dark.style.display = "block";
}
else{
dark.style.display = "none";
}
}
function resizeGrayOut() {
var dark=document.getElementById('darkScreen');
if (dark)
{
dark.style.width = getFullWidth() + "px";
dark.style.height = getScreenHeight() + "px";
}
}
function hideDropDowns(vis){
var dd = document.getElementsByTagName("select");
if(!vis){
for(x = 0; x < dd.length; x++){
dd[x].style.display = dd[x].oldDisplay;
}
}
else{
for(x = 0; x < dd.length; x++){
dd[x].oldDisplay = dd[x].style.display;
dd[x].style.display = "none";
}
}
}
function setOpacity(obj, opacity){
obj.style.opacity = opacity;
obj.style.MozOpacity = opacity;
obj.style.filter = "alpha(opacity=" + (opacity*100) + ")";
}
function getScreenHeight(){
if (self.innerHeight)
return self.innerHeight;
else if (document.documentElement && document.documentElement.clientHeight)
return document.documentElement.clientHeight;
else if (document.body)
return document.body.clientHeight;
}
function getScreenWidth(){
if (self.innerWidth)
return self.innerWidth;
else if (document.documentElement && document.documentElement.clientWidth)
return document.documentElement.clientWidth;
else if (document.body)
return document.body.clientWidth;
}
function getFullHeight(){
var d = document.getElementsByTagName("body")[0];
if(d.scrollHeight)
return d.scrollHeight;
else
return d.offsetHeight;
}
function getFullWidth(){
var d = document.getElementsByTagName("body")[0];
if(d.scrollWidth)
return d.scrollWidth;
else
return d.offsetWidth;
}
var keepAdjusting = false;
var adjustWait = 10;
var adjustTotalWait = 100; //10000;
var adjustCount = 0;
function adjustLocation(){
var display = document.getElementById("displayPopup");
if (!display || display.style.display == "none")
{
return -1;
}
var t = ((getScreenHeight() - display.offsetHeight)/2) + document.body.scrollTop;
var l = ((getScreenWidth() - display.offsetWidth)/2) + document.body.scrollLeft;
if(t < 0) t = 0;
if(l < 0) l = 0;
if(keepAdjusting && (adjustCount++*adjustWait)<adjustTotalWait){
display.style.top = t + "px";
display.style.left = l + "px";
setTimeout("adjustLocation()",adjustWait);
}
else{
keepAdjusting = false;
adjustCount = 0;
}
return 0;
}
function displayHtml(vis, html){
var display = document.getElementById("displayPopup");
if(!display){
display = document.createElement("div");
display.style.position = "absolute";
display.style.overflow = "hidden";
display.style.display = "none";
display.id = "displayPopup";
document.getElementsByTagName("body")[0].appendChild(display);
}
keepAdjusting = vis;
if(vis){
display.style.zIndex = 100;
display.style.backgroundColor = "#101010";
display.style.className = "htmlPopup";
display.style.display = "block";
display.innerHTML = html;
adjustLocation();
}
else{
display.style.display = "none";
display.innerHTML = "";
}
}
function showFocusRect(element)
{
delStyleClass(element, 'blur');
if (! hasStyleClass(element, 'focus'))
{
addStyleClass(element, 'focus');
}
}
function hideFocusRect(element)
{
delStyleClass(element, 'focus');
if (! hasStyleClass(element, 'blur'))
{
addStyleClass(element, 'blur');
}
}
function adjustListRecordsHeight()
{
var div = document.getElementById("listRecords");
// var topParent = getLeftContainer();
var topParent = document.getElementById("leftContent");
// var node = div.parentNode;
// var adjustY = node.offsetTop + node.paddingTop + node.paddingBottom;
// var adjustX = node.offsetLeft + node.paddingLeft + node.paddingRight;
var adjustY = 0;
var adjustX = 0;
var node = div;
while (node != null && node != document.documentElement)
{
adjustY += node.offsetTop;// + node.paddingTop + node.paddingBottom;
adjustX += node.offsetLeft; // + node.paddingLeft + node.paddingRight);
// alert(node.offsetLeft);
node = node.parentNode;
if (node == topParent)
{
break;
}
}
div.style.height = (topParent.offsetHeight - adjustY - 7) + "px";
div.style.width = (topParent.offsetWidth - adjustX - 4) + "px";
}
function donate()
{
var form = document.getElementById("donateForm");
form.submit();
}
if (typeof WsResources == "undefined") var WsResources = new Object();
WsResources.FileUploadHelper = function()
{
this.displayNameField = null;
this.internalFileNameField = null;
}
WsResources.FileUploadHelper.prototype = {
setElements: function(displayNameField, internalFileNameField)
{
this.displayNameField = displayNameField;
this.internalFileNameField = internalFileNameField;
},
updateFields: function(displayName, internalFileName)
{
if (this.displayNameField != null)
{
this.displayNameField.setAttribute("value", displayName);
}
if (this.internalFileNameField != null)
{
this.internalFileNameField.setAttribute("value", internalFileName);
}
}
}
var fileUploadHelper = new WsResources.FileUploadHelper();
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213var messageFilterTimer;
var lastFilterText;
var lastFormatBtn = null;
var lastFormat = null;
function downloadTemplate(id)
{
window.location = "/download.template?Id=" + id;
}
function downloadMessage(eid)
{
window.location = "/download.message?eid=" + eid;
}
function setListFormat(format)
{
var x = document.getElementsByName("format");
if (x.length == 0)
{
return;
}
var elem;
if (format != null && lastFormat != null && format != lastFormat)
{
elem = document.getElementById("tabIcon" + lastFormat);
changeTabCellClass(elem, "tabIconOn", "tabIconOff");
elem = document.getElementById("tabCaption" + lastFormat);
changeTabCellClass(elem, "tabCaptionOn", "tabCaptionOff");
}
if (format != null && format != lastFormat)
{
elem = document.getElementById("tabIcon" + format);
changeTabCellClass(elem, "tabIconOff", "tabIconOn");
elem = document.getElementById("tabCaption" + format);
changeTabCellClass(elem, "tabCaptionOff", "tabCaptionOn");
lastFormat = format;
}
x[0].value = format;
loadMessageListRecords();
}
function changeTabCellClass(element, oldClass, newClass)
{
if (hasStyleClass(element, oldClass))
{
delStyleClass(element, oldClass);
}
if (! hasStyleClass(element, newClass))
{
addStyleClass(element, newClass);
}
}
function loadMainContainer(uri)
{
var container = getContainer("mainContainer");
loadContainer(uri, container, onLoadContainer);
}
function onKeyupMessageFilter(textField)
{
if (textField.value == lastFilterText)
{
return;
}
lastFilterText = textField.value;
if (messageFilterTimer != null)
{
clearTimeout(messageFilterTimer);
}
messageFilterTimer = setTimeout("gotoPage(1)", 500);
}
function clearMessageFilter(textField)
{
if (textField.value == "")
{
return;
}
textField.value = lastFilterText = "";
if (messageFilterTimer != null)
{
clearTimeout(messageFilterTimer);
}
textField.focus();
gotoPage(1);
}
function onSortMessages(columnIndex)
{
var field = document.getElementsByName("sortColumn")[0];
var oldIndex = field.value;
field.value = columnIndex;
field = document.getElementsByName("sortDirection")[0];
if (oldIndex != columnIndex)
{
field.value = 1;
}
else
{
field.value = (field.value < 0) ? 1 : -1;
}
gotoPage(1);
}
function gotoPage(pageNumber)
{
var field = document.getElementsByName("page")[0];
field.value = pageNumber;
loadMessageListRecords(true);
}
function selectTranslation(tableRow, id, languageId)
{
var format = document.getElementsByName("format")[0].value;
selectRecord(tableRow, id);
loadArtifacts(id, languageId, format);
}
function clickLanguageButton(languageCode)
{
window.location = languageCode + getShowEnglishQuery(true);
}
function loadMessageList(languageId)
{
var container = document.getElementById("mainContainer");
loadContainer("/translated_messages.do?languageId=" + languageId + getShowEnglishQuery(false), container, onLoadContainer, false);
}
function loadMessageListContent(languageId)
{
var container = document.getElementById("leftContent");
loadContainer("/message_list.do?languageId=" + languageId + getShowEnglishQuery(false), container, onLoadContainer, true);
}
function loadMessageListRecords()
{
var form = document.getElementById("messageListForm");
var container = document.getElementById("messageListRecords");
var field = document.getElementsByName("show_en")[0];
field.value = getShowEnglishValue();
submitForm(form, container, onLoadContainer, true)
}
function loadArtifacts(tmId, languageId, format)
{
var container = document.getElementById("messageRecordDetails");
loadContainer("message_artifacts.do?tmId=" + tmId + "&languageId=" + languageId + "&format=" + format + getShowEnglishQuery(false), container, null, true);
}
// function playWmbMp3(eid)
// {
// var url = "/play_message.do?eid=" + eid;
// openPopup(url, "playMessage", 500, 250)
// }
// function loadMessagePlayer(file, id, autostart)
// {
// var so1 = new SWFObject("/include/mediaplayer.swf", "flvplayer", "450", "100", "9", "#ffffff");
// so1.addParam('allowscriptaccess', 'always');
// so1.addParam("wmode", "opaque");
// so1.addVariable("height", "100");
// so1.addVariable("width", "450");
// so1.addVariable("volume", "100");
// so1.addVariable("backcolor", "0x000000");
// so1.addVariable("frontcolor", "0xCCCCCC");
// so1.addVariable("lightcolor", "0x990000");
// so1.addVariable("screencolor", "000000");
// so1.addVariable("bufferlength", "5");
// so1.addVariable("autostart", autostart == null ? "false" : autostart);
// so1.addVariable("file", file);
// so1.addVariable("id", id);
// so1.write("messagePlayer");
// }
function getShowEnglishQuery(isFirstParam)
{
var value = getShowEnglishValue();
if (value == "")
{
return "";
}
return (isFirstParam ? "?" : "&") + "show_en=" + value;
}
function getShowEnglishValue()
{
var qs = new Querystring();
return qs.get("show_en", "");
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta name="keywords"
content="Message Hub, translated messages, Jesus Christ, Jesus, prophet, pillar of fire, fire, branham, william, william branham, william marrion branham, elijah, malachi, sermons, translations">
<meta name="description" content="Message Hub - Translated sermons from the ministry of William Marrion Branham">
<title>Message Hub</title>
<link rel="shortcut icon" href="/images/template/bbw_logo.ico"/>
<link href="/include/style.css" rel="stylesheet" type="text/css"/>
<link href="/include/messagehub.css?1" rel="stylesheet" type="text/css"/>
<link href="/include/bidi-left.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/include/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="/include/querystring.js"></script>
<script type="text/javascript" src="/include/WsMenu.js"></script>
<script type="text/javascript" src="/include/functions.js?1"></script>
<script type="text/javascript" src="/include/messagehub.js"></script>
<link type="text/css" href="/include/jquery-ui-1.8.5.custom/css/excite-bike/jquery-ui-1.8.5.custom.css"
rel="stylesheet"/>
<script type="text/javascript" src="/include/jquery-ui-1.8.5.custom/js/jquery-ui-1.8.5.custom.min.js"></script>
</head>
<body class="messageHub" onload="//windowOnLoad()">
<div id="pageHeader" style="">
<a href="https://portal.messagehub.info" style="cursor: pointer" target="_blank" title="New MessageHub Website">
<img src="/images/template/messagehub_banner_narrow2.png" width="1200" height="220" border="0">
</a>
</div>
<div id="hubToolbar">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<table class="toolbar" cellpadding="0" cellspacing="0" border="0">
<tr class="" onclick="window.location='/home.do'">
<td class="icon" style="background-image:url(/images/toolbar/tb_home.png);"></td>
<td class="label">Home
</td>
</tr>
</table>
</td>
<td>
<table class="toolbar" cellpadding="0" cellspacing="0" border="0">
<tr class="selected" onclick="window.location='messages.do'">
<td class="icon" style="background-image:url(/images/icons/search-icon.png);"></td>
<td class="label">Message Search
</td>
</tr>
</table>
</td>
<td>
<table class="toolbar" cellpadding="0" cellspacing="0" border="0">
<tr onclick="window.location='message_index.do'">
<td class="icon" style="background-image:url(/images/icons/index-icon.png);"></td>
<td class="label">Message Index
</td>
</tr>
</table>
</td>
<td>
<table class="toolbar" cellpadding="0" cellspacing="0" border="0">
<tr onclick="window.location='contact.do'">
<td class="icon" style="background-image:url(/images/icons/contact-icon.png);"></td>
<td class="label">Contact Us
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--</table>-->
<div class="pageBody">
<script type="text/javascript">
var formatsAvailable = [];
</script>
<h1 class="headerBar">English Messages
</h1>
<div class="pageBody" style="margin:0;padding:0px; ">
<div class="tabStrip">
<table cellpadding="0" cellspacing="0" border="0" align="left">
<tr class="tabRow" onclick="setListFormat('Book')">
<td id="tabIconBook" class="tabIcon tabIconOn"><img
src="/images/icons/printer-icon.png"
alt="Printed Books" title="Printed Books">
</td>
<td id="tabCaptionBook" class="tabCaption tabCaptionOn">Printed Books
</td>
</tr>
</table>
<script type="text/javascript">
formatsAvailable[formatsAvailable.length] = "Book";
</script>
<table cellpadding="0" cellspacing="0" border="0">
<tr class="tabRow" onclick="setListFormat('Audio')">
<td id="tabIconAudio" class="tabIcon tabIconOff"><img
src="/images/icons/speaker-icon.png"
alt="Audio" title="Audio">
</td>
<td id="tabCaptionAudio" class="tabCaption tabCaptionOff">Audio
</td>
</tr>
</table>
<script type="text/javascript">
formatsAvailable[formatsAvailable.length] = "Audio";
</script>
</div>
<div class="tabbedContent">
<div class="search">
<form id="messageListForm" action="/en/message_list_records.do"
onsubmit="return false;">
<input type="hidden" name="tableCode" value="TranslatedMessages"><input type="hidden" name="sortColumn" value=""><input type="hidden" name="sortDirection" value=""><input type="hidden" name="page" value=""><input type="hidden" name="filterParameters" value=""><input type="hidden" name="languageId" value=""><input type="hidden" name="show_en" value=""><input type="hidden" name="format" value="">
Search for a message by typing its reference number, title and/or location:
<br/>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="middle"><input name="filterText" class="editField" type="text"
maxlength="100" size="100"
onkeyup="onKeyupMessageFilter(this);"></td>
<td> </td>
<td style="vertical-align:middle;"><button style="font-size:8pt;margin:0;padding:0"
onclick="clearMessageFilter(document.getElementsByName('filterText')[0])">
Clear
</button>
</td>
</tr>
</table>
</form>
</div>
<div id="pageContents" style="overflow:hidden">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td width="70%" class="messageList">
<div id="messageListRecords" style="overflow:hidden;"></div>
</td>
<td class="messageArtifacts">
<h2 class="headerBar">Available Formats
</h2>
<div id="artifactList" style="position:relative;overflow-x:hidden;overflow-y:scroll">
<div id="messageRecordDetails" style="">
<div class="artifactList" style="padding:5px">To select a Message for downloading, click its reference number from the list.
</div>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<script type="text/javascript">
var field = document.getElementsByName("languageId")[0];
field.value = "53";
if (formatsAvailable.length > 0)
{
setListFormat(formatsAvailable[0]);
// setListFormat("Book");
}
var contentHeight = $(window).height() - $("#artifactList").offset().top - 6;
$("#artifactList").height(contentHeight);
$(window).resize(function()
{
var container, contentHeight;
container = $("#messageList");
if (container.offset() != null)
{
contentHeight = $(window).height() - container.offset().top - 6;
container.height(contentHeight);
}
container = $("#artifactList");
if (container.offset() != null)
{
contentHeight = $(window).height() - container.offset().top - 6;
container.height(contentHeight);
}
});
</script>
</div>
<map name="bbw_logo" id="bbw_logo">
<area shape="rect" coords="35,5,160,130" href="/" alt="Message Hub Home Page"
title="Message Hub Home Page"/>
</map>
<div style="display:none">
<form id="donateForm" action="https://www.pushpay.com/pay/biblebelievers" method="get" target="_blank">
</form>
</div>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-0C0V4K6064"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-0C0V4K6064');
</script>
</body>
</html>
1234567891011121314151617
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
<div class="recordCount">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="vertical-align:middle;">
1184 Messages found
</td>
<td>
<table class="pageNumbers bidiFloatRight" cellpadding="1" cellspacing="2" border="0"><tr>
<td class="pageBtn bidiFirstPageBtnDis toolbarButtonDisabled"> </td><td class="pageBtn bidiPrevPageBtnDis toolbarButtonDisabled"> </td><td>Page </td><td><select class="toolbarField" onchange="gotoPage(this.value);"><option value=1 selected>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option><option value=11>11</option><option value=12>12</option><option value=13>13</option><option value=14>14</option><option value=15>15</option><option value=16>16</option><option value=17>17</option><option value=18>18</option><option value=19>19</option><option value=20>20</option><option value=21>21</option><option value=22>22</option><option value=23>23</option><option value=24>24</option><option value=25>25</option><option value=26>26</option><option value=27>27</option><option value=28>28</option><option value=29>29</option><option value=30>30</option><option value=31>31</option><option value=32>32</option><option value=33>33</option><option value=34>34</option><option value=35>35</option><option value=36>36</option><option value=37>37</option><option value=38>38</option><option value=39>39</option><option value=40>40</option></select></td><td class="pageBtn bidiNextPageBtn toolbarButton" onclick="gotoPage(2)"> </td><td class="pageBtn bidiLastPageBtn toolbarButton" onclick="gotoPage(40)"> </td>
</tr></table>
</td>
</tr>
</table>
</div>
<div id="messageList" style="position:relative;background-color:#FFFFFF;overflow-x:hidden;overflow-y:scroll">
<table class="messageList" bborder="0" cellpadding="0" cellspacing="0" width="100%">
<thead>
<tr>
<th class="headerRow" onclick="onSortMessages(0)">
Reference Number
</th>
<th class="headerRow" onclick="onSortMessages(1)">
Title
</th>
<th class="headerRow" onclick="onSortMessages(2)">
Location
</th>
<th class="headerRow" onclick="onSortMessages(3)">
Updated On
</th>
<th class="headerRow" onclick="onSortMessages(4)">
Added On
</th>
</tr>
</thead>
<tbody>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 712, '53')">
<td class="leftColumn" style="">61-0212E</td>
<td class="middleColumn" style="">It Is I, Be Not Afraid</td>
<td class="middleColumn" style="">Long Beach, California, USA</td>
<td class="middleColumn" style="">2026-03-25</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 714, '53')">
<td class="leftColumn" style="">61-0213</td>
<td class="middleColumn" style="">And Thy Seed Shall Possess The Gate Of His Enemies</td>
<td class="middleColumn" style="">Long Beach, California, USA</td>
<td class="middleColumn" style="">2026-03-25</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 98, '53')">
<td class="leftColumn" style="">53-0611</td>
<td class="middleColumn" style="">Show Us The Father And It'll Satisfy Us</td>
<td class="middleColumn" style="">Connersville, Indiana, USA</td>
<td class="middleColumn" style="">2026-03-25</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 4387, '53')">
<td class="leftColumn" style="">47-1207</td>
<td class="middleColumn" style="">Experiences</td>
<td class="middleColumn" style="">Phoenix, Arizona, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2014-02-17</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 4466, '53')">
<td class="leftColumn" style="">48-0000</td>
<td class="middleColumn" style="">Prayer Line</td>
<td class="middleColumn" style="">Unknown</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2014-02-17</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 3, '53')">
<td class="leftColumn" style="">47-1123</td>
<td class="middleColumn" style="">The Children of Israel</td>
<td class="middleColumn" style="">Phoenix, Arizona, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 5, '53')">
<td class="leftColumn" style="">47-1221</td>
<td class="middleColumn" style="">Experiences</td>
<td class="middleColumn" style="">Phoenix, Arizona, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 4461, '53')">
<td class="leftColumn" style="">48-0302</td>
<td class="middleColumn" style="">Experiences</td>
<td class="middleColumn" style="">Phoenix, Arizona, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2014-02-17</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 2, '53')">
<td class="leftColumn" style="">47-1102</td>
<td class="middleColumn" style="">The Angel Of God</td>
<td class="middleColumn" style="">Phoenix, Arizona, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 1, '53')">
<td class="leftColumn" style="">47-0412</td>
<td class="middleColumn" style="">Faith Is The Substance</td>
<td class="middleColumn" style="">Oakland, California, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 6, '53')">
<td class="leftColumn" style="">48-0304</td>
<td class="middleColumn" style="">The Angel Of God</td>
<td class="middleColumn" style="">Phoenix, Arizona, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 7, '53')">
<td class="leftColumn" style="">48-0305</td>
<td class="middleColumn" style="">At Thy Word, Lord</td>
<td class="middleColumn" style="">Phoenix, Arizona, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 8, '53')">
<td class="leftColumn" style="">49-0718</td>
<td class="middleColumn" style="">I Was Not Disobedient To The Heavenly Vision</td>
<td class="middleColumn" style="">Zion, Illinois, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 10, '53')">
<td class="leftColumn" style="">50-0100</td>
<td class="middleColumn" style="">Diseases And Afflictions</td>
<td class="middleColumn" style="">Louisville, Kentucky, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 9, '53')">
<td class="leftColumn" style="">49-1225</td>
<td class="middleColumn" style="">The Deity Of Jesus Christ</td>
<td class="middleColumn" style="">Jeffersonville, Indiana, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 11, '53')">
<td class="leftColumn" style="">50-0110</td>
<td class="middleColumn" style="">Moses</td>
<td class="middleColumn" style="">Houston, Texas, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 13, '53')">
<td class="leftColumn" style="">50-0200</td>
<td class="middleColumn" style="">Here We Have No Continuing City</td>
<td class="middleColumn" style="">Little Rock, Arkansas, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 12, '53')">
<td class="leftColumn" style="">50-0115</td>
<td class="middleColumn" style="">Believest Thou This?</td>
<td class="middleColumn" style="">Houston, Texas, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 16, '53')">
<td class="leftColumn" style="">50-0405</td>
<td class="middleColumn" style="">Expectation</td>
<td class="middleColumn" style="">New York, New York, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 14, '53')">
<td class="leftColumn" style="">50-0227</td>
<td class="middleColumn" style="">God In His People</td>
<td class="middleColumn" style="">Little Rock, Arkansas, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 15, '53')">
<td class="leftColumn" style="">50-0300</td>
<td class="middleColumn" style="">Gifts And Callings Are Without Repentance</td>
<td class="middleColumn" style="">Carlsbad, New Mexico, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 17, '53')">
<td class="leftColumn" style="">50-0711</td>
<td class="middleColumn" style="">Ministry Explained</td>
<td class="middleColumn" style="">Minneapolis, Minnesota, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 4388, '53')">
<td class="leftColumn" style="">50-0409</td>
<td class="middleColumn" style="">Baptismal Service</td>
<td class="middleColumn" style="">Jeffersonville, IN USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2014-02-17</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 18, '53')">
<td class="leftColumn" style="">50-0713</td>
<td class="middleColumn" style="">Obey The Voice Of The Angel</td>
<td class="middleColumn" style="">Minneapolis, Minnesota, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 19, '53')">
<td class="leftColumn" style="">50-0714</td>
<td class="middleColumn" style="">At Thy Word</td>
<td class="middleColumn" style="">Minneapolis, Minnesota, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 21, '53')">
<td class="leftColumn" style="">50-0716</td>
<td class="middleColumn" style="">Believest Thou This?</td>
<td class="middleColumn" style="">Minneapolis, Minnesota, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 20, '53')">
<td class="leftColumn" style="">50-0715</td>
<td class="middleColumn" style="">Led By The Spirit</td>
<td class="middleColumn" style="">Minneapolis, Minnesota, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2008-05-29</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 4390, '53')">
<td class="leftColumn" style="">50-0810</td>
<td class="middleColumn" style="">Expectations</td>
<td class="middleColumn" style="">Cleveland, OH USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2014-02-17</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 4389, '53')">
<td class="leftColumn" style="">50-0808</td>
<td class="middleColumn" style="">Healing And What Sickness Is</td>
<td class="middleColumn" style="">Cleveland, Ohio, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2014-02-17</td>
</tr>
<tr class="dataRow" onmouseover="hiOn(this)" onmouseout="hiOff(this)"
onclick="selectTranslation(this, 4391, '53')">
<td class="leftColumn" style="">50-0811</td>
<td class="middleColumn" style="">The Pool Of Bethesda</td>
<td class="middleColumn" style="">Cleveland, Ohio, USA</td>
<td class="middleColumn" style="">2014-02-17</td>
<td class="rightColumn" style="">2014-02-17</td>
</tr>
</tbody>
</table>
</div>
<script id="jsCommand" type="text/javascript">
var contentHeight = $(window).height() - $("#messageList").offset().top - 6;
$("#messageList").height(contentHeight);
</script>
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
import osimport re
FOLDER = r"./sermons" # change this to your folder path
mapping = { "47-0412": "Faith Is The Substance", "47-1100X": "Fellowship", "47-1102": "The Angel Of God", "47-1123": "The Children of Israel", "47-1200": "Testimonies", "47-1207": "Experiences", "47-1221": "Experiences", "48-0000": "Prayer Line", "48-0302": "Experiences", "48-0304": "The Angel Of God", "48-0305": "At Thy Word, Lord", "49-0718": "I Was Not Disobedient To The Heavenly Vision", "49-1225": "The Deity Of Jesus Christ", "50-0100": "Diseases And Afflictions", "50-0110": "Moses", "50-0115": "Believest Thou This?", "50-0200": "Here We Have No Continuing City", "50-0227": "God In His People", "50-0300": "Gifts And Callings Are Without Repentance", "50-0405": "Expectation", "50-0409": "Baptismal Service", "50-0711": "Ministry Explained", "50-0713": "Obey The Voice Of The Angel", "50-0714": "At Thy Word", "50-0715": "Led By The Spirit", "50-0716": "Believest Thou This?", "50-0808": "Healing And What Sickness Is", "50-0810": "Expectations", "50-0811": "The Pool Of Bethesda", "50-0813A": "The Resurrection Of Lazarus", "50-0813E": "God Revealing Himself To His People", "50-0814": "Testimony", "50-0815": "Who Is God?", "50-0816": "Looking To The Unseen", "50-0818": "It Shall Be Even As It Was Told Me", "50-0819": "Show Us The Father And It Suffices", "50-0820A": "My Life Story", "50-0820E": "Believe Ye That I Am Able To Do This?", "50-0821": "The Angel And The Commission", "50-0822": "Faith Without Works Is Dead", "50-0823": "Testimony", "50-0824": "To Whom Is The Arm Of The Lord Revealed?", "50-0827A": "Prodigal", "50-0827E": "Take The Rod And Gather The People", "51-0413": "The Works That I Do Bear Witness Of Me", "51-0414": "The Angel of the Lord", "51-0415A": "Life Story", "51-0415E": "The Hour Is Come", "51-0501": "Exhortation of Divine Healing", "51-0502": "The Angel Of The Lord", "51-0503": "As I Was With Moses", "51-0505": "My Commission", "51-0506A": "Believest Thou This?", "51-0506E": "At Thy Word", "51-0507": "Expectations", "51-0508": "Faith Is The Substance", "51-0509": "Testimony", "51-0714": "Expectation", "51-0717": "The Manifestation Of The Spirit", "51-0718": "The Angel Of The Lord", "51-0719": "Who Hath Believed Our Report?", "51-0720": "The Angel Of God", "51-0721": "Life Of Demons", "51-0722A": "Life Story", "51-0722E": "The Second Miracle", "51-0727": "The Church Of The Living God", "51-0728": "Three Witnesses", "51-0729A": "The Resurrection Of Lazarus", "51-0729E": "The Second Miracle", "51-0923": "The Principles Of Divine Healing", "51-0928": "At Thy Word", "51-0929": "Our Hope Is In God", "51-0930": "Expectation", "51-0930A": "What Think Ye Of Christ?", "51-1003": "Believest Thou This?", "52-0224": "Believing God", "52-0713A": "Early Spiritual Experiences", "52-0713E": "God Testifying Of His Gifts", "52-0715": "Faith In The Son Of God", "52-0716": "Thou Knowest All Things", "52-0717": "Get The People To Believe", "52-0718": "For Him Will I Accept", "52-0719": "Make the Valley Full of Ditches", "52-0720A": "Life Story", "52-0720E": "Who Has Believed Our Report?", "52-0725": "Faith (Africa Trip Report)", "52-0726": "Experiences", "52-0727": "Led By The Holy Spirit", "52-0809": "Deep Calleth Unto The Deep", "52-0810A": "I Am The Resurrection And The Life", "52-0810E": "Jesus Christ The Same Yesterday, Today, And Forever", "52-0816": "Faith (Africa Trip Report)", "52-0817A": "Expectancy", "52-0817E": "Do You Now Believe?", "52-0900": "God's Way That's Been Made For Us", "52-1027": "Jesus Christ The Same Yesterday, Today, And Forever", "53-0215": "Jesus Christ The Same Yesterday, Today, And Forever", "53-0216": "My Angel Shall Go Before Thee", "53-0217": "Only Believe", "53-0218": "All Things Are Possible To Them That Believe", "53-0219": "Accept God's Gift", "53-0325": "Israel And The Church #1", "53-0326": "Israel And The Church #2", "53-0327": "Israel And The Church #3", "53-0328": "Israel And The Church #4", "53-0329": "Israel And The Church #5", "53-0403": "The Cruelty Of Sin, And The Penalty That It Cost To Rid Sin From Our Lives", "53-0405E": "Witnesses", "53-0405M": "Prayer", "53-0405S": "Go, Tell My Disciples", "53-0500": "Prayer Line", "53-0506": "Jesus Christ The Same Yesterday, Today And Forever", "53-0507": "Expectations", "53-0508": "God Commissioning Moses", "53-0509": "The Pillar Of Fire", "53-0510": "Testimony", "53-0511": "We Have Found Him, Come And See", "53-0512": "Speak To The Rock", "53-0513": "God's Provided Way", "53-0531": "Seeking After Jesus", "53-0600": "Prayer Line", "53-0601": "Whatever He Says To You, Do It", "53-0602": "The Authority Of The Word", "53-0603": "God Commissioning Moses", "53-0604": "The Angel Of The Lord", "53-0605": "The Beginning Of Jesus' Fame", "53-0606": "An Ensign", "53-0607A": "The Ministry of Christ", "53-0607E": "A Testimony", "53-0608A": "Demonology, Physical Realm", "53-0608E": "At Thy Word", "53-0609A": "Demonology, Religious Realm", "53-0609E": "Make The Valley Full Of Ditches", "53-0610": "Show Us The Father And It'll Satisfy Us", "53-0612": "Palmerworm, Locust, Cankerworm, Caterpillar", "53-0613": "God's Provided Way", "53-0614A": "Earnestly Contending For The Faith That Was Once Delivered To The Saints", "53-0614E": "I Perceive That Thou Art A Prophet", "53-0729": "Questions And Answers On Genesis", "53-0800": "The Twentieth-Century Prophet", "53-0829": "The Testimony Of Jesus Christ", "53-0830A": "Why I Am A Holy-Roller", "53-0830E": "Come And See", "53-0831": "God Talked To Moses", "53-0901": "Lord, I Believe", "53-0902": "Testimony", "53-0903": "Expectancy", "53-0904": "Healing (What Cancer Is)", "53-0905": "Faith Without Works Is Dead", "53-0906A": "Believest Thou This?", "53-0906E": "The Living Jesus Christ", "53-0907A": "Lord, Show Us The Father And It Sufficeth Us", "53-0907E": "Healing Line", "53-1018": "Elijah", "53-1100": "Prayer Line", "53-1103": "Taking God At His Word", "53-1104": "Deep Calleth Unto The Deep", "53-1106": "Do You Now Believe?", "53-1107": "Jesus Christ The Same Yesterday, Today, And Forever", "53-1108A": "Life Story", "53-1108E": "Expectancy", "53-1109": "How The Angel Came To Me", "53-1110": "I Will Restore", "53-1111": "Preparation", "53-1112": "Demonology", "53-1114": "Africa Trip Report", "53-1115": "Speak To The Rock", "53-1115A": "Speak To The Rock", "53-1115E": "A Greater Witness", "53-1118": "Prayer Line Prayer Line", "53-1120": "Demonology", "53-1121": "Brass Serpent", "53-1122": "The Resurrection Of Lazarus", "53-1127": "Prayer Line", "53-1129A": "The Faith That Was Once Delivered To The Saints", "53-1129E": "Testimony", "53-1130": "Has The Lord Spoken Only To Moses?", "53-1201": "God's Provided Way", "53-1203": "Testimony (Raising Dead Boy)", "53-1204": "At Thy Word", "53-1205": "The Resurrection", "53-1206A": "Life Story", "53-1206E": "Do You Now Believe?", "53-1212": "The Inside Man", "53-1213E": "Faith", "53-1213M": "What Think Ye Of Christ?", "54-0103E": "Questions And Answers #2", "54-0103M": "Questions And Answers #1", "54-0216": "Jairus And Divine Healing", "54-0217": "Jesus On The Authority Of The Word", "54-0220": "Expectation", "54-0221": "At Thy Word, Lord", "54-0228A": "Expectation", "54-0228E": "Looking For Jesus", "54-0301": "The Angel Of The Covenant", "54-0302": "The Resurrection Of Jairus' Daughter", "54-0303": "Witnesses", "54-0304": "Elijah And Elisha", "54-0305": "God's Provided Way Of Dealing With Sin", "54-0306": "The Unconditional Covenant That God Made With His People", "54-0307A": "The End Time", "54-0307E": "Do You Now Believe?", "54-0314": "Why I'm Praying For The Sick", "54-0320": "Faith Cometh By Hearing", "54-0321": "What Think Ye Of Christ?", "54-0328": "Sirs, We Would See Jesus", "54-0329": "Redemption By Power", "54-0330": "Redemption In Completeness,In Joy", "54-0331": "The Resurrection of Jairus' Daughter", "54-0401": "God's Preparation", "54-0402": "Blind Bartimaeus", "54-0403": "The Hand Of The Lord Came Upon Him", "54-0404E": "God Has A Provided Way", "54-0404M": "Earnestly Contending For The Faith", "54-0411": "Thy Faith Has Saved Thee", "54-0509": "The Invasion Of The United States", "54-0512": "The Seven Church Ages", "54-0513": "The Mark Of The Beast", "54-0514": "The Seal Of God", "54-0515": "Questions And Answers", "54-0516": "Questions and Answers", "54-0619": "Prayer Line", "54-0620A": "I Will Restore", "54-0620E": "Divine Healing", "54-0624": "The Deep Calleth To The Deep", "54-0718A": "The Great Coming Revival And The Outpouring Of The Holy Spirit", "54-0718E": "To See Jesus", "54-0719A": "God's Provided Way Of Healing", "54-0719E": "God Providing Healing For This Generation", "54-0720A": "The Maniac Of Gadara", "54-0720E": "It Is I, Be Not Afraid", "54-0721": "Sirs, Be Of A Good Cheer", "54-0722": "Whatever He Saith Unto You, Do It", "54-0723": "The Prophet Elisha", "54-0724": "A Personal Experience With God", "54-0725": "Do You Now Believe?", "54-0803": "Jairus", "54-0804": "Simeon Simeon", "54-0809A": "I Will Restore Unto You, Saith The Lord", "54-0809E": "The Manifestation Of Thy Resurrection To The People Of This Day", "54-0810": "Prayer Line", "54-0811": "Show Us The Father", "54-0812": "Prayer Line", "54-0813": "Jesus Christ the Same Yesterday, Today & Forever", "54-0814": "The Unconditional Covenant That God Made With The People", "54-0824": "Jesus Christ The Same Yesterday, Today, And Forever", "54-0825": "We Have Found Him", "54-0829A": "I Will Restore, Saith The Lord I Will Restore, Saith The Lord", "54-0829E": "Jesus Christ The Same Yesterday, Today, And Forever Jesus Christ The Same Yesterday, Today, And Forever", "54-0900": "Have Faith In God", "54-0902": "South Africa Testimony", "54-1003E": "Jubilee Year", "54-1003M": "The Word Became Flesh (India Trip Report)", "54-1006": "Law Or Grace", "54-1024": "The Unpardonable Sin", "54-1114": "Redemption By Judgment", "54-1203": "The Law Having A Shadow", "54-1204": "God Perfecting His Church", "54-1205": "We Would See Jesus", "54-1206": "Expectation", "54-1207": "At Thy Word, Lord, I'll Let Down The Net", "54-1212": "He Swore By Himself", "54-1219E": "Acts Of The Holy Spirit", "54-1219M": "Divine Healing", "54-1231": "Everlasting Life And How To Receive It", "55-0109E": "Beginning And Ending Of The Gentile Dispensation", "55-0109M": "Melchisedec, The Great Prince And King", "55-0113": "The Fundamental Foundation For Faith", "55-0114": "Doctor Moses", "55-0115": "Law", "55-0116A": "The Believer's Position In Christ", "55-0116E": "Jesus Christ The Same Yesterday, Today, And Forever", "55-0117": "How The Angel Came To Me, And His Commission", "55-0118": "This Great Warrior, David", "55-0119": "This Great Warrior, Joshua", "55-0120": "The Seven Compound Names Of Jehovah", "55-0121": "The Water Of Separation", "55-0122": "This Great Servant, Moses", "55-0123A": "The Approach To God", "55-0123E": "Earnestly Contend For The Faith", "55-0220A": "The Second Coming", "55-0220E": "Contend For The Faith", "55-0221": "Christ", "55-0222": "Jehovah-Jireh", "55-0223": "Job", "55-0224": "Water From The Rock", "55-0225": "Glorified Jesus", "55-0227A": "The Position Of A Believer In Christ", "55-0227E": "The Healing Of Jairus' Daughter", "55-0228": "Separation From Unbelief", "55-0301": "Elijah", "55-0302": "The Curtain Of Time", "55-0311": "The Seal Of The Antichrist", "55-0312": "The Seal Of The Christ", "55-0400": "Blind Bartimaeus Blind Bartimaeus", "55-0403": "Fellowship By Redemption", "55-0410E": "Prayer", "55-0410M": "Proof Of His Resurrection", "55-0410S": "My Redeemer Liveth", "55-0501A": "Fellowship", "55-0501E": "The Faith That Was Once Delivered To The Saints", "55-0522": "The Ark", "55-0603": "Jesus Christ The Same Yesterday, Today, And Forever", "55-0604": "Jairus, A Secret Believer", "55-0605": "Fellowship Through The Reconciliation Of The Blood", "55-0606": "The Waters Of Separation", "55-0607": "The True Vine And A False Vine", "55-0608": "Abraham", "55-0609": "A Greater Witness Than John", "55-0610": "Do You Now Believe?", "55-0611": "What Is That In Thy Hand?", "55-0612": "The Presence Of The Lord Jesus", "55-0620": "Contending For The Faith", "55-0621": "The Roman Nobleman", "55-0624": "Abraham", "55-0625": "Show Us The Father", "55-0626A": "My Life Story", "55-0626E": "I Will Restore", "55-0724": "Enticing Spirits", "55-0731": "The Uncertain Sound", "55-0806": "Jesus Christ The Same Yesterday, Today, And Forever", "55-0807A": "Pride", "55-0807E": "Leading Of The Spirit Of God", "55-0813": "Fellowship", "55-0815": "Earnestly Contending For The Faith That Was Once Delivered Unto The Saints", "55-0817": "Jehovah-Jireh", "55-0818": "Blind Bartimaeus", "55-0819": "Being Led By The Holy Spirit", "55-0826": "The Same Jesus Tonight", "55-0828A": "The Unwelcomed Christ", "55-0828E": "Sir, We Would See Jesus", "55-0911": "The Unwelcomed Christ", "55-0930": "Prayer Line Prayer Line", "55-1001": "Expectation", "55-1002": "The Unwelcomed Christ", "55-1003": "Faith In Action", "55-1004": "Come, Let Us Reason Together", "55-1005": "The Power Of The Devil", "55-1006A": "A Hidden Life", "55-1006E": "The Power Of God", "55-1007": "The Power Of Decision", "55-1008": "The Results Of Decision", "55-1009": "The Way To Have Fellowship", "55-1110": "A Hidden Life In Christ", "55-1111": "Where I Think Pentecost Failed", "55-1113": "Jesus Christ The Same Yesterday, Today, And Forever", "55-1114": "The Darkest Hour, Then Jesus Comes Along", "55-1115": "Blind Bartimaeus", "55-1116": "The Calling Of Abraham", "55-1117": "Jehovah-Jireh", "55-1118": "The Faith Of Abraham", "55-1119": "Redeemer, Redemption", "55-1120": "What Is That In Your Hand", "56-0101": "Why Are People So Tossed About?", "56-0108": "God Hath A Provided Way", "56-0115": "The Junction Of Time", "56-0120": "Fellowship With God Through Reconciliation", "56-0121": "The Inter-Veil", "56-0122": "The Junction Time", "56-0128": "Inspiration", "56-0129": "The Supernatural", "56-0200": "Contending For The Faith", "56-0212": "Fellowship", "56-0213": "Hidden Life With Christ", "56-0218B": "When Love Is Projected", "56-0218E": "The Worst Sinner In The City", "56-0219": "Being Led Of The Holy Spirit", "56-0223": "God's Covenant With Abraham And His Seed", "56-0224": "Jehovah-Jireh", "56-0225": "Jesus Christ The Same Yesterday, Today, And Forever", "56-0304": "Making A Way", "56-0311A": "The True and False Vines", "56-0311E": "God Using His Gift", "56-0401M": "The Mighty Conqueror", "56-0401S": "Easter Sunrise", "56-0403": "Shepherd Of The Sheepfold", "56-0404": "The Infallibility Of God's Spoken Word", "56-0405": "The Resurrection Of Jesus", "56-0406": "The Infallible Word Of God", "56-0407": "Blind Bartimaeus", "56-0408A": "What Is A Vision?", "56-0408E": "The Time Is At Hand", "56-0414": "Blind Bartimaeus", "56-0415": "The Deep Calling To The Deep", "56-0419": "Earnestly Contending For The Faith That Was Once Delivered Unto The Saints", "56-0420": "When Their Eyes Were Opened", "56-0421": "What Visions Are", "56-0422": "Show Us The Father And It'll Satisfy", "56-0426": "Jesus Christ The Same Yesterday, Today, And Forever", "56-0427": "Faith", "56-0428": "God's Covenant With Abraham", "56-0429": "Jehovah-Jireh", "56-0513": "Teaching On Moses", "56-0527": "At Kadesh-Barnea", "56-0603": "The Lamb's Book Of Life", "56-0610": "Perfection", "56-0611": "Hear Ye Him", "56-0614": "God Provided A Lamb", "56-0615": "An Exodus", "56-0617": "Revelation, Book Of Symbols", "56-0621": "The Law Having A Shadow", "56-0715": "The Mark Of The Beast", "56-0722": "All Things Are Possible To Him That Believeth", "56-0723": "Led By The Spirit Of God", "56-0726": "Love", "56-0728": "Making The Valley Full Of Ditches", "56-0731": "Raising Jairus' Daughter", "56-0801": "The Arrow Of God's Deliverance Shot From A Bow", "56-0805": "The Church And Its Condition", "56-0814": "Divine Love And Sovereign Grace", "56-0815": "Faith", "56-0816": "The Working Of The Holy Spirit", "56-0826": "Divine Love", "56-0902": "The Handwriting On The Wall", "56-0916": "Azusa Jubilee", "56-0917": "The Lamb And The Dove", "56-0923": "Spiritual Adoption", "56-0930": "Hear Ye Him", "56-1001": "The Ministry Explained", "56-1002A": "Father, The Hour Has Come", "56-1002E": "Elisha The Prophet", "56-1004": "Witnesses", "56-1005": "Painted-Face Jezebel", "56-1006": "A Wedding Supper", "56-1125E": "A Blushing Prophet", "56-1125M": "A Secondhanded Robe", "56-1206": "A Secondhanded Robe", "56-1207": "Gifts", "56-1208": "Abraham", "56-1209A": "God Making His Promise", "56-1209E": "Jehovah-Jireh", "56-1215": "Hear Ye Him", "56-1230": "Joseph Meeting His Brethren", "57-0104": "Sirs, We Would See Jesus", "57-0105": "Hear Ye Him", "57-0106": "Jehovah-Jireh", "57-0113": "What Does It Take To Make A Christian Life?", "57-0114": "The Infallible Proof Of The Resurrection", "57-0115": "God Keeps His Word", "57-0120E": "God Keeps His Word", "57-0120M": "The Impersonation Of Christianity", "57-0125": "Hear Ye Him", "57-0126B": "India Trip Report", "57-0126E": "When Divine Love Is Projected", "57-0127A": "The Impersonation Of Christianity", "57-0127E": "Blind Bartimaeus", "57-0226": "Sirs, We Would See Jesus", "57-0228": "A Greater Than Solomon Is Here", "57-0301": "Blind Bartimaeus", "57-0302": "And Then Jesus Came", "57-0303A": "Why Is It That So Many Christians Find It So Hard To Live The Christian Life?", "57-0303E": "What Think Ye Of Christ?", "57-0305": "Divine Love", "57-0306": "God Keeps His Word #1", "57-0307": "God Keeps His Word #2", "57-0308": "The Good Shepherd Of The Sheep", "57-0309B": "I Will Restore", "57-0309E": "Jehovah-Jireh", "57-0310A": "Washing Jesus' Feet", "57-0310E": "Hear Ye Him", "57-0317": "Hear Ye Him", "57-0322": "Hear Ye Him", "57-0323": "God In His Word", "57-0324": "Why Some People Can't Keep The Victory?", "57-0325": "The Lamb And The Dove", "57-0326": "Jehovah-Jireh", "57-0407E": "Then Jesus Came", "57-0407M": "God Keeps His Word", "57-0414": "Corinthians, Book Of Correction", "57-0417": "The Second Coming Of The Lord", "57-0418": "The Communion", "57-0419": "The Perfection", "57-0420": "The Entombment", "57-0421E": "And Their Eyes Were Opened And They Knew Him", "57-0421S": "The Great And Mighty Conqueror", "57-0516": "We Would See Jesus", "57-0517": "The Queen Of Sheba", "57-0518": "Stand Still", "57-0519A": "Hear Ye Him", "57-0519E": "Love", "57-0602": "Life", "57-0610": "Faith Once Delivered To The Saints", "57-0611": "Life Is The Healer", "57-0612": "Jehovah-Jireh", "57-0613": "Thirsting For Life", "57-0614": "The Queen Of The South", "57-0623": "Believe From The Heart", "57-0629": "Stand Still And See The Salvation Of The Lord", "57-0630": "Thirsting For Life", "57-0705": "The Eagle In Her Nest", "57-0714": "As The Eagle Stirreth Up Her Nest As The Eagle Stirreth Up Her Nest", "57-0725": "Hear Ye Him", "57-0727": "He Was To Pass That Way", "57-0728": "Thirsting For Life", "57-0804A": "The Great Commission", "57-0804E": "Sirs, We Would See Jesus", "57-0805": "God Manifesting His Gifts", "57-0806": "God Projecting His Love", "57-0807": "Hear Ye Him", "57-0808": "The Mighty Conqueror", "57-0809": "Blind Bartimaeus", "57-0810": "Jehovah-Jireh", "57-0811A": "The Greatest Gift In The Bible", "57-0811E": "Expectations And Leadings Of The Spirit", "57-0818": "Time-Tested Memorials Of God", "57-0821": "Hebrews, Chapter One", "57-0825E": "Hebrews, Chapter Two #2", "57-0825M": "Hebrews, Chapter Two #1", "57-0828": "Hebrews, Chapter Two #3", "57-0901E": "Hebrews, Chapter Four", "57-0901M": "Hebrews, Chapter Three", "57-0908E": "Hebrews, Chapter Six", "57-0908M": "Hebrews, Chapter Five And Six", "57-0915E": "Hebrews, Chapter Seven #1", "57-0915M": "Hebrews, Chapter Six And Seven", "57-0922": "Hebrews, Chapter Seven #2", "57-0922E": "Hebrews, Chapter Seven #2", "57-0922M": "Jesus Christ the Same Yesterday, Today & Forever", "57-0925": "Questions And Answers On Hebrews #1", "57-1002": "Questions And Answers On Hebrews #2", "57-1006": "Questions And Answers On Hebrews #3", "57-1208": "I Stand At The Door And Knock", "57-1211": "Sirs, We Would See Jesus", "57-1212": "The Door Of The Door", "57-1213": "And Then Jesus Came", "57-1215": "Speak To This Mountain", "57-1222": "The Great Shining Light", "57-1229": "Faith", "58-0105": "Have Faith In God", "58-0107": "The Queen Of Sheba", "58-0108": "The Handwriting On The Wall", "58-0109": "The Called-Out", "58-0110": "The Mighty Conqueror", "58-0112A": "His Wonders To Perform", "58-0112E": "The Door To The Heart", "58-0125": "The Queen Of The South", "58-0126": "Hear Ye Him", "58-0127": "Jehovah-Jireh", "58-0128": "The Oneness Of Unity", "58-0130": "The Handwriting On The Wall", "58-0202": "Escape Hither, Come Quickly", "58-0207": "Jesus Christ The Same Yesterday, Today, And Forever", "58-0208": "The Queen Of The South", "58-0209A": "Hear Ye Him", "58-0209E": "The Door Inside The Door", "58-0214": "Jesus Christ The Same Yesterday, Today, And Forever", "58-0215": "Queen Of Sheba", "58-0223": "Jesus Christ The Same Yesterday, Today, And Forever", "58-0225": "God's Eye", "58-0228": "Thy Loving Kindness", "58-0301B": "The Great Commission", "58-0301E": "Hear Ye Him", "58-0302": "Door To The Heart", "58-0309E": "Will The Church Go Before The Tribulation?", "58-0309M": "The Handwriting On The Wall", "58-0312": "Jesus Christ The Same Yesterday, Today, And Forever", "58-0313": "The Queen Of Sheba", "58-0314": "Love", "58-0315": "Faith", "58-0316A": "As The Eagle Stirs Her Nest And Fluttereth Over Her Young", "58-0316E": "Door To The Heart", "58-0323": "Jesus Christ The Same Yesterday, Today, And Forever", "58-0324": "Hear Ye Him", "58-0325": "Faith By Experience", "58-0326": "United Under One Head", "58-0328": "God Keeps His Word", "58-0329": "The Mighty Conqueror", "58-0330A": "A Missionary Talk", "58-0330E": "Christ Knocking At The Door", "58-0406E": "The Evidence Of The Resurrection", "58-0406S": "I Know My Redeemer Liveth", "58-0500": "The Eagle Stirring Her Nest", "58-0501": "We Would See Jesus", "58-0503": "The Queen Of Sheba", "58-0508": "The Expectations", "58-0510": "Have Faith In God", "58-0512": "Life", "58-0515": "Jesus Christ The Same Yesterday, Today, And Forever", "58-0517": "Zacchaeus", "58-0517B": "Zacchaeus", "58-0517E": "The Sin Of Unbelief", "58-0518": "Tested Faith Produces Goods", "58-0519": "Life", "58-0520": "The Sign Of The Time", "58-0521": "Behold, I Stand At The Door And Knock", "58-0523": "We Would See Jesus", "58-0524": "Jesus Of Nazareth Passeth By", "58-0528": "The Sign Of The Messiah", "58-0529": "Jesus At The Door", "58-0530": "Time-Tested Faith", "58-0609": "The Message To The Laodicean Church", "58-0610": "The Mighty Conqueror", "58-0611": "Thirsting For Life", "58-0612": "We Would See Jesus", "58-0613": "The Queen Of The South", "58-0617": "Behold, I Stand At The Door And Knock", "58-0618": "Handwriting On The Wall", "58-0619B": "Ye Must Be Born Again", "58-0619E": "Can We See Jesus?", "58-0620": "The Queen Of The South", "58-0625": "A Greater Than Solomon Is Here", "58-0720A": "By Faith, Moses", "58-0720E": "The Placing Of Deacons", "58-0720M": "By Faith, Moses", "58-0927": "Why Are We Not A Denomination?", "58-0928E": "The Serpent's Seed", "58-0928M": "The Baptism Of The Holy Spirit", "58-1001": "Lifting Him Up Out Of History", "58-1002": "But From The Beginning It Was Not So", "58-1003": "Looking At The Unseen", "58-1004": "Faith Is Our Victory", "58-1005E": "God-Called Man", "58-1005M": "Hear His Voice", "58-1007": "Church Order", "58-1012": "The Sudden, Secret Going Away Of The Church", "58-1130": "Watchman, What Of The Night?", "58-1211E": "The Unity Of One God In The One Church", "58-1221E": "The Unity Of One God In The One Church", "58-1221M": "Where Is He, King Of The Jews?", "58-1228": "Why Little Bethlehem?", "59-0125": "Be Certain Of God", "59-0209": "Blind Bartimaeus", "59-0211": "Simeon And Anna", "59-0301E": "What Does Thou Here?", "59-0301M": "Strait Is The Gate", "59-0329E": "The Sign Of The Messiah", "59-0329M": "Water Baptism", "59-0329S": "Living, Dying, Buried, Rising, Coming", "59-0403": "Living, Dying, Buried, Rising, Coming", "59-0404": "What Is The Works Of God?", "59-0405A": "It Was Not So From The Beginning", "59-0405E": "The Queen Of Sheba", "59-0406": "New Ministry (William Branham)", "59-0407": "Led By The Spirit", "59-0408": "Blind Bartimaeus", "59-0409": "Mary's Belief", "59-0410": "Looking At The Unseen", "59-0411B": "Testimony", "59-0411E": "Watching His Star", "59-0412A": "Be Certain Of God", "59-0412E": "What Hearest Thou, Elijah?", "59-0414": "Thirsting For Life", "59-0415A": "God's Provided Way", "59-0415E": "The Faith Of Abraham", "59-0416": "El-Shaddai", "59-0417": "Jehovah-Jireh", "59-0418": "A Time Of Decision", "59-0419A": "My Life Story", "59-0419E": "Show Us The Father And It Will Satisfy Us", "59-0422": "We Would See Jesus", "59-0423": "Abraham's Seed", "59-0424A": "The Faith Of Abraham", "59-0424E": "Hear Ye Him", "59-0510E": "Who Is This?", "59-0510M": "Mother's Day", "59-0525": "Images Of Christ", "59-0609": "What Hearest Thou, Elijah?", "59-0610": "As I Thought On My Way", "59-0611": "The Time Of Decision", "59-0612": "All The Days Of Our Life", "59-0613": "Thirsting For Life", "59-0614": "Balm In Gilead", "59-0628E": "Questions And Answers", "59-0628M": "A Deceived Church, By The World", "59-0702": "Where Has Thy Strength Gone, Samson?", "59-0706": "Thinking On Our Way", "59-0707": "Balm In Gilead", "59-0708E": "Be Certain Of God", "59-0708M": "Dedication Of Building, To The Lord", "59-0712": "A Total Deliverance", "59-0802": "Without Money Or Without Price", "59-0810": "The Reaction To An Action", "59-0811": "It Is I, Be Not Afraid", "59-0812": "Discerning The Body Of The Lord", "59-0813": "Why?", "59-0814": "As I Thought On My Ways", "59-0815": "As The Eagle Stirreth Up Her Nest", "59-0823": "Palmerworm, Locust, Cankerworm, Caterpillar", "59-0920": "Planting The Vine And Where To Plant It", "59-1001": "What Went Ye Out To See?", "59-1004E": "Why Cry? Speak!", "59-1004M": "Who Is This?", "59-1108": "Possessing The Enemy's Gates", "59-1115": "My New Ministry", "59-1120": "A Prophet Like Unto Moses", "59-1121": "Thy Seed Shall Possess The Gate Of His Enemy", "59-1122": "Who Is This?", "59-1123": "Speak To This Mountain", "59-1124": "Balm In Gilead", "59-1125": "From The Beginning It Wasn't So", "59-1126": "Jehovah Of Miracles", "59-1127": "Blind Bartimaeus", "59-1128": "Door To The Heart", "59-1129": "Let Us See God", "59-1216": "What Is The Holy Ghost?", "59-1217": "What Was The Holy Ghost Given For?", "59-1219": "Questions & Answers On The Holy Ghost", "59-1220E": "Identified With Christ", "59-1220M": "Conference With God", "59-1223": "Questions And Answers", "59-1227E": "A Super Sense", "59-1227M": "A Super Sign", "59-1231": "And From That Time", "60-0108": "Conference With God", "60-0109": "Sirs, We Would See Jesus", "60-0110": "The Queen Of Sheba", "60-0210": "The Revelation That Was Given To Me", "60-0210E": "And From That Time", "60-0221": "Hearing, Recognizing, Acting On The Word Of God", "60-0228": "Conferences", "60-0229": "The Oncoming Storm", "60-0301": "He Careth For You", "60-0302": "From That Time", "60-0303": "Former And Latter Rain", "60-0304": "Thirsting For Life", "60-0305": "Be Not Afraid, It Is I", "60-0306": "It Wasn't So From The Beginning", "60-0308": "Discernment Of Spirit", "60-0309": "Why?", "60-0310": "Elijah And The Meal-Offering", "60-0311": "Mary's Belief", "60-0312": "Door To The Heart", "60-0313": "Hear Ye Him", "60-0326": "The Unchangeable God", "60-0328": "Is There Anything Too Hard For The Lord?", "60-0329": "It Is I, Be Not Afraid", "60-0330": "Blind Bartimaeus", "60-0331": "From That Time", "60-0401E": "The Queen Of Sheba", "60-0401M": "Why?", "60-0402": "Believest Thou This?", "60-0403": "As The Eagle Stirreth", "60-0417M": "Go, Tell", "60-0417S": "I Know", "60-0515E": "Adoption #1", "60-0515M": "The Rejected King", "60-0518": "Adoption #2", "60-0522E": "Adoption #4", "60-0522M": "Adoption #3", "60-0604": "To Whom Shall We Go?", "60-0606": "To Whom Would We Go?", "60-0607": "Hearing, Receiving, And Acting", "60-0608": "Having Conferences", "60-0609": "Be Not Afraid", "60-0610": "The Rejected King", "60-0611B": "Fellowship", "60-0611E": "Faith Is The Sixth Sense", "60-0612": "Speak To This Rock", "60-0626": "The Unfailing Realities Of The Living God", "60-0630": "God's Provided Approach To Divine Fellowship", "60-0708": "Sir, We Would See Jesus", "60-0709": "God's Provided Way Of Approach To Fellowship", "60-0710": "The Queen Of Sheba", "60-0711": "The Door Inside The Door", "60-0712": "Hear Ye Him", "60-0713": "Blind Bartimaeus", "60-0716": "From That Time", "60-0717": "Be Not Afraid", "60-0720": "It Is I", "60-0722": "Watchman, What Of The Night?", "60-0723": "Speak To The Rock And It Shall Give Forth His Water", "60-0724": "The Unchangeable Word Of God", "60-0729": "What It Takes To Overcome All Unbelief: Our Faith", "60-0731": "Show Us The Father And It Will Satisfy Us", "60-0802": "El Shaddai", "60-0803": "Abraham", "60-0804": "As The Eagle Stirreth Up Her Nest", "60-0805": "Lamb And Dove", "60-0806": "Hear Ye Him", "60-0807": "Debate On Tongues", "60-0911E": "Five Definite Identifications Of The True Church Of The Living God", "60-0911M": "As I Was With Moses, So Will I Be With Thee", "60-0924": "Condolences to Stadsklev Family", "60-0925": "That Day On Calvary", "60-0930": "Visions Of William Branham", "60-1002": "The Kinsman Redeemer", "60-1113": "Condemnation By Representation", "60-1124": "It Is I", "60-1125": "Conference", "60-1126": "Why?", "60-1127E": "The Queen Of The South", "60-1127M": "It Wasn't So From The Beginning", "60-1204E": "The Patmos Vision", "60-1204M": "The Revelation Of Jesus Christ", "60-1205": "The Ephesian Church Age", "60-1206": "The Smyrnaean Church Age", "60-1207": "The Pergamean Church Age", "60-1208": "The Thyatirean Church Age", "60-1209": "The Sardisean Church Age", "60-1210": "The Philadelphian Church Age", "60-1211E": "The Laodicean Church Age", "60-1211M": "The Ten Virgins, And The Hundred And Forty-Four Thousand Jews", "60-1218": "The Uncertain Sound", "60-1225": "God's Wrapped Gift", "60-1231": "Revelation, Chapter Four #1", "61-0101": "Revelation, Chapter Four #2", "61-0108": "Revelation, Chapter Four #3", "61-0112": "Questions And Answers", "61-0117": "The Messiah", "61-0118": "Jesus Christ The Same Yesterday, Today, And Forever", "61-0119E": "Queen Of Sheba", "61-0119M": "Things That Wasn't So From The Beginning", "61-0120": "The Water Baptism", "61-0121": "Mary's Belief", "61-0122": "As The Eagle Stirs Her Nest", "61-0123": "Be Not Afraid, It Is I", "61-0124": "Blind Bartimaeus", "61-0125": "Why?", "61-0128": "Why?", "61-0129": "Turning Northward", "61-0205E": "Jesus Christ The Same Yesterday, Today, And Forever", "61-0205M": "Expectation", "61-0207": "Expectation", "61-0208": "Sirs, We Would See Jesus", "61-0209": "Jehovah-Jireh", "61-0210": "Abraham's Covenant Confirmed", "61-0211": "Abraham", "61-0212E": "And Thy Seed Shall Possess The Gate Of His Enemies", "61-0212M": "Jehovah-Jireh", "61-0213": "It Is I, Be Not Afraid", "61-0214": "The Basis Of Fellowship", "61-0215": "Thou Son Of David, Have Mercy On Me", "61-0216": "The Mark Of The Beast And The Seal Of God #1", "61-0217": "The Mark Of The Beast And The Seal Of God #2", "61-0218": "Balm In Gilead", "61-0219": "The Queen Of Sheba", "61-0224": "Be Not Afraid", "61-0226": "Jehovah-Jireh", "61-0305": "Beyond The Curtain Of Time", "61-0308": "Expectations", "61-0311": "Be Not Afraid", "61-0312": "Jehovah-Jireh", "61-0315": "An Uncertain Sound", "61-0316": "The Church Choosing Law For Grace", "61-0317": "Abraham's Grace Covenant", "61-0318": "Abraham's Covenant Confirmed", "61-0319": "Jezebel Religion", "61-0402": "The True Easter Seal", "61-0409": "Sirs, We Would See Jesus", "61-0410": "Conferences", "61-0411": "But It Wasn't So From The Beginning", "61-0412": "A Greater Than Solomon Is Here", "61-0413": "Why?", "61-0414": "Be Not Afraid, It Is I", "61-0415B": "From That Time", "61-0415E": "The Uncertain Sound", "61-0416": "Abraham And His Seed After Him", "61-0423": "Abraham And His Seed After Him", "61-0424": "The Greatest News Flash In History", "61-0425B": "The Godhead Explained", "61-0425E": "The Forgotten Beatitude", "61-0426": "Micaiah The Prophet", "61-0427": "Only Believe", "61-0428": "Getting In The Spirit", "61-0429B": "One Of The Meanest Men In Town", "61-0429E": "The Uncertain Sound", "61-0430": "Super Sign", "61-0515": "A Greater Than Solomon Is Here", "61-0516A": "Jesus Christ The Same Yesterday, Today, And Forever", "61-0516M": "God's Provided Way", "61-0517": "It Is I", "61-0519": "Sirs, We Would See Jesus", "61-0520": "From That Time", "61-0521": "Show Us The Father", "61-0611": "Revelation, Chapter Five #1", "61-0618": "Revelation, Chapter Five #2", "61-0723E": "God Being Misunderstood", "61-0723M": "The Ever-Present Water From The Rock", "61-0730E": "The Sixfold Purpose Of Gabriel's Visit To Daniel", "61-0730M": "Gabriel's Instructions To Daniel", "61-0806": "The Seventieth Week Of Daniel", "61-0808": "Thy House", "61-0813": "Faith", "61-0827": "The Message Of Grace", "61-0903": "Let Your Light So Shine Before Men", "61-1001E": "The Comforter", "61-1001M": "It Becometh Us To Fulfil All Righteousness", "61-1015E": "Respects", "61-1015M": "Questions And Answers", "61-1105": "The Testimony Of A True Witness", "61-1112": "A True Sign That's Overlooked", "61-1119": "Perfect Strength By Perfect Weakness", "61-1210": "Paradox", "61-1217": "Christianity Versus Idolatry", "61-1224": "Sirs, We Would See Jesus", "61-1231E": "If God Be With Us, Then Where Is All The Miracles?", "61-1231M": "Ye Must Be Born Again", "62-0117": "Presuming", "62-0118": "Convinced Then Concerned", "62-0119": "An Ensign", "62-0120": "The Unchangeable God Working In An Unexpectable Way", "62-0121E": "The Marriage Of The Lamb", "62-0121M": "And Thy Seed Shall Possess The Gate Of His Enemy", "62-0122": "Confirmation Of The Commission", "62-0123": "Forsaking All", "62-0124": "Have Not I Sent Thee?", "62-0127": "Meanest Man I Know", "62-0128A": "A Paradox", "62-0128M": "Unbelief Does Not Hinder God", "62-0129": "Explaining The Ministry", "62-0204": "Communion", "62-0211": "Oneness", "62-0218": "Perseverance", "62-0311": "The Greatest Battle Ever Fought", "62-0313": "Expressions", "62-0318": "The Spoken Word Is The Original Seed", "62-0318A": "The Spoken Word Is The Original Seed Pt 2", "62-0318E": "The Spoken Word is the Original Seed 2", "62-0318M": "The Spoken Word Is The Original Seed Pt 1", "62-0319": "The End-Time Sign Seed", "62-0401": "Wisdom Versus Faith", "62-0407": "The Signs Of His Coming", "62-0408": "Presuming", "62-0422": "The Restoration Of The Bride Tree", "62-0506": "Possessing All Things", "62-0513E": "Letting Off The Pressure", "62-0513M": "The Way Of A True Prophet Of God", "62-0518": "Letting Off The Pressure", "62-0519": "Fellowship", "62-0520": "Perseverance", "62-0521": "Convinced And Then Concerned", "62-0527": "Questions And Answers", "62-0531": "The Conflict Between God And Satan", "62-0601": "Taking Sides With Jesus", "62-0603": "The End-Time Evangelism", "62-0607": "Putting On The Whole Armor Of God", "62-0608": "Perseverance", "62-0609E": "Letting Off The Pressure", "62-0609M": "Show Us The Father And It Will Sufficeth Us", "62-0610E": "Convinced Then Concerned", "62-0610M": "Presuming", "62-0611": "It Is I, Be Not Afraid", "62-0612": "Behold, A Greater Than Solomon Is Here", "62-0620": "Be Not Afraid", "62-0621B": "The Path Of Life", "62-0621E": "Confirmation And Evidence", "62-0622B": "Letting Off The Pressure", "62-0622E": "Why?", "62-0623": "Perseverant", "62-0624": "Super Sign", "62-0627": "We Would See Jesus", "62-0628": "A Greater Than Solomon Is Here", "62-0629": "Be Not Afraid, It Is I", "62-0630B": "It Wasn't So From The Beginning", "62-0630E": "The Meanest Man In Santa Maria", "62-0701": "To Take On The Whole Armor Of God", "62-0704": "We Would See Jesus", "62-0705": "Jehovah-Jireh #1", "62-0706": "Jehovah-Jireh #2", "62-0707": "Jehovah-Jireh #3", "62-0708": "A Super Sign", "62-0711": "Hear Ye Him", "62-0712": "We Would See Jesus", "62-0713": "From That Time", "62-0714": "The Uncertain Sound", "62-0715": "Behold, A Greater Than All Of Them Is Here", "62-0718": "Jesus Christ The Same Yesterday, Today, And Forever", "62-0719B": "Life", "62-0719E": "Perseverant", "62-0720": "A Testimony On The Sea", "62-0721": "Behold, A Greater Than Solomon Is Here", "62-0722": "Show Us The Father And It Will Suffice Us", "62-0724": "Sir, We Would See Jesus", "62-0725": "A Greater Than Solomon Is Here", "62-0726": "A Testimony On The Sea", "62-0727": "We Would See Jesus", "62-0728": "God Has A Provided Way", "62-0729": "Perseverant", "62-0908": "Present Stage Of My Ministry", "62-0909E": "In His Presence", "62-0909M": "Countdown", "62-1007": "The Key To The Door", "62-1013": "The Influence Of Another", "62-1014E": "A Guide", "62-1014M": "The Stature Of A Perfect Man", "62-1030X": "Vision From The Lord", "62-1104E": "Ordination", "62-1104M": "Blasphemous Names", "62-1111E": "Why I'm Against Organized Religion", "62-1111M": "Dedication", "62-1122": "Return And Jubilee", "62-1123": "The Way Back", "62-1124B": "Investments", "62-1124E": "All Things", "62-1125E": "The Countdown", "62-1125M": "Convinced And Then Concerned", "62-1209": "Remembering The Lord", "62-1216": "The Falling Apart Of The World", "62-1223": "The Reproach For The Cause Of The Word", "62-1230E": "Is This The Sign Of The End, Sir?", "62-1230M": "Absolute", "62-1231": "The Contest", "63-0112": "Influence", "63-0113E": "Perseverance", "63-0113M": "Letting Off Pressure", "63-0114": "A Trumpet Gives An Uncertain Sound", "63-0115": "Accepting God's Provided Way At The End Time", "63-0116": "The Evening Messenger", "63-0117": "Awakening Jesus", "63-0118": "Spirit Of Truth", "63-0119": "The Way Of A True Prophet", "63-0120E": "Just One More Time, Lord", "63-0120M": "The Voice Of God In This Last Days", "63-0121": "Zacchaeus, The Businessman", "63-0122": "Remembering The Lord", "63-0123": "Identification", "63-0126": "Investments", "63-0127": "An Absolute", "63-0223": "A Door In A Door", "63-0304": "A Absolute", "63-0317E": "The Breach Between The Church Ages And The Seven Seals", "63-0317M": "God Hiding Himself In Simplicity, Then Revealing Himself In The Same", "63-0318": "The First Seal", "63-0319": "The Second Seal", "63-0320": "The Third Seal", "63-0321": "The Fourth Seal", "63-0322": "The Fifth Seal", "63-0323": "The Sixth Seal", "63-0324E": "The Seventh Seal", "63-0324M": "Questions And Answers On The Seals", "63-0412E": "God Hiding Himself In Simplicity", "63-0412M": "The World Is Falling Apart", "63-0421": "Victory Day", "63-0428": "Look", "63-0601": "Come, Follow Me", "63-0604": "Jesus Christ The Same Yesterday, Today, And Forever", "63-0605": "Greater Than Solomon Is Here", "63-0606": "Show Us The Father", "63-0607": "Be Not Afraid", "63-0608": "Conferences", "63-0623E": "The Flashing Red Light Of The Sign Of His Coming", "63-0623M": "Standing In The Gap", "63-0626": "Why?", "63-0627": "Jesus Christ The Same Yesterday, Today, And Forever", "63-0628A": "O Lord, Just Once More", "63-0628E": "A Greater Than Solomon Is Here", "63-0628M": "Oh Lord, Just Once More", "63-0630E": "Is Your Life Worthy Of The Gospel?", "63-0630M": "The Third Exodus", "63-0707E": "Communion", "63-0707M": "The Indictment", "63-0714E": "Humble Thyself", "63-0714M": "Why Cry? Speak!", "63-0717": "A Prisoner", "63-0721": "He Cares. Do You Care?", "63-0724": "God Doesn't Call Man To Judgment Without First Warning Him", "63-0728": "Christ Is The Mystery Of God Revealed", "63-0731": "There Is Only One Way Provided By God For Anything", "63-0801": "A Paradox", "63-0802": "Perseverant", "63-0803B": "Investments", "63-0803E": "Influence", "63-0804A": "Once More", "63-0804E": "Calling Jesus On The Scene", "63-0818": "The Uniting Time And Sign", "63-0825E": "Perfect Faith", "63-0825M": "How Can I Overcome?", "63-0901E": "Desperations", "63-0901M": "Token", "63-1028": "Pardon", "63-1103": "Go, Wake Jesus", "63-1110E": "He That Is In You", "63-1110M": "Souls That Are In Prison Now", "63-1112": "Sir, We Would See Jesus", "63-1113": "The Sign Of This Time", "63-1114": "Influence", "63-1115": "The World Is Falling Apart", "63-1116B": "Investments", "63-1116E": "Perseverance", "63-1117": "Once More", "63-1118": "I Am The Resurrection And Life", "63-1124E": "Three Kinds Of Believers", "63-1124M": "What Shall I Do With Jesus Called Christ?", "63-1127": "The World Is Again Falling Apart", "63-1128E": "The Token", "63-1128M": "Testimony", "63-1129": "The Super Sign", "63-1130B": "Influence", "63-1130E": "Go, Awake Jesus", "63-1201E": "Just Once More, Lord", "63-1201M": "An Absolute", "63-1201X": "Wedding Ceremony", "63-1214": "Why Little Bethlehem?", "63-1216": "We Have Seen His Star And Have Come To Worship Him", "63-1222": "God's Gifts Always Find Their Places", "63-1226": "Church Order", "63-1229E": "Look Away To Jesus", "63-1229M": "There Is A Man Here That Can Turn On The Light", "64-0112": "Shalom", "64-0119": "Shalom", "64-0120": "His Unfailing Words Of Promise", "64-0121": "God's Word Calls For A Total Separation From Unbelief", "64-0122": "Looking Unto Jesus", "64-0125": "Turn On The Light", "64-0126": "What Shall We Do With This Jesus Called Christ?", "64-0205": "God Is His Own Interpreter", "64-0206B": "Paradox", "64-0206E": "God's Provided Way For This Day", "64-0207": "The Patriarch Abraham", "64-0208": "The Token", "64-0209": "Countdown", "64-0212": "When Their Eyes Were Opened, They Knew Him", "64-0213": "Then Jesus Came And Called", "64-0214": "The Voice Of The Sign", "64-0215": "Influences", "64-0216": "Identification", "64-0304": "Sirs, We Would See Jesus", "64-0305": "Perseverant", "64-0306": "A Greater Than Solomon Is Here Now", "64-0307": "A Testimony On The Sea", "64-0308": "The Token", "64-0311": "God Is Identified By His Characteristics", "64-0312": "When Their Eyes Were Opened, They Knew Him", "64-0313": "The Voice Of The Sign", "64-0314": "The Investments", "64-0315": "Influence", "64-0318": "Sir, We Would See Jesus", "64-0319": "Calling Jesus On The Scene", "64-0320": "God Identifying Himself By His Characteristics", "64-0321B": "He Was To Pass This Way", "64-0321E": "The Voice Of The Sign", "64-0322": "Possessing The Gate Of The Enemy After Trial", "64-0401": "The Identified Christ Of All Ages", "64-0402": "Jehovah-Jireh 1", "64-0403": "Jehovah-Jireh 2", "64-0404": "Jehovah-Jireh 3", "64-0405": "A Trial", "64-0409": "The Identification Of Christ In All Ages", "64-0410": "Scriptural Signs Of The Time", "64-0411": "Spiritual Amnesia", "64-0412": "A Court Trial", "64-0415": "Christ Is Identified The Same In All Generations", "64-0416": "And When Their Eyes Were Opened, They Knew Him", "64-0417": "Then Jesus Came And Called", "64-0418B": "A Paradox", "64-0418E": "Jesus Keeps All His Appointments", "64-0419": "The Trial", "64-0427": "A Trial", "64-0531": "The Oddball", "64-0614E": "The Oddball", "64-0614M": "The Unveiling Of God", "64-0617": "The Identified Christ Of All Ages", "64-0618": "The Presence Of God Unrecognized", "64-0619": "Perseverant", "64-0620B": "Who Is Jesus", "64-0620E": "God Has A Provided Lamb", "64-0621": "The Trial", "64-0629": "The Mighty God Unveiled Before Us", "64-0705": "The Masterpiece", "64-0705X": "Private Interview", "64-0719E": "Going Beyond The Camp", "64-0719M": "The Feast Of The Trumpets", "64-0726E": "Broken Cisterns", "64-0726M": "Recognizing Your Day And Its Message", "64-0802": "The Future Home Of The Heavenly Bridegroom And The Earthly Bride", "64-0816": "Proving His Word", "64-0823E": "Questions And Answers 2", "64-0823M": "Questions And Answers 1", "64-0830E": "Questions And Answers 4", "64-0830M": "Questions And Answers 3", "64-1205": "The Identified Masterpiece Of God", "64-1212": "The Harvest Time", "64-1221": "Why It Had To Be Shepherd", "64-1227": "Who Do You Say This Is", "65-0116X": "Wedding Ceremony", "65-0117": "A Paradox", "65-0118": "The Seed Of Discrepancy", "65-0119": "The God Who Is Rich In Mercy", "65-0120": "Lean Not Unto Thy Own Understanding", "65-0123": "Broken Cisterns", "65-0124": "Birth Pains", "65-0125": "This Day This Scripture Is Fulfilled", "65-0206": "Doors In Door", "65-0217": "A Man Running From The Presence Of The Lord", "65-0218": "The Seed Is Not Heir With The Shuck", "65-0219": "This Day This Scripture Is Fulfilled", "65-0220": "Gods Chosen Place Of Worship", "65-0220X": "Wedding Ceremony", "65-0221E": "Who Is This Melchisedec", "65-0221M": "Marriage And Divorce", "65-0410": "The Easter Seal", "65-0418E": "Does God Ever Change His Mind About His Word", "65-0418M": "It Is The Rising Of The Sun", "65-0424": "One In A Million", "65-0425": "Gods Provided Place Of Worship", "65-0426": "Proving His Word", "65-0427": "Does God Change His Mind", "65-0429B": "The Seed Shall Not Be Heir With The Shuck", "65-0429E": "The Choosing Of A Bride", "65-0527": "Last Visit To South Africa", "65-0711": "Ashamed", "65-0718E": "Spiritual Food In Due Season", "65-0718M": "Trying To Do God A Service Without Being The Will Of God", "65-0725E": "What Is The Attraction On The Mountain", "65-0725M": "The Anointed Ones At The End Time", "65-0801E": "Events Made Clear By Prophecy", "65-0801M": "The God Of This Evil Age", "65-0815": "And Knoweth It Not", "65-0822E": "A Thinking Man's Filter", "65-0822M": "Christ Is Revealed In His Own Word", "65-0829": "Satans Eden", "65-0911": "Gods Power To Transform", "65-0919": "Thirst", "65-1031A": "Leadership", "65-1031M": "Power Of Transformation", "65-1121": "What House Will You Build Me", "65-1125": "The Invisible Union Of The Bride Of Christ", "65-1126": "Works Is Faith Expressed", "65-1127B": "Trying To Do God A Service Without It Being Gods Will", "65-1127E": "I Have Heard But Now I See", "65-1128E": "On The Wings Of A Snow White Dove", "65-1128M": "Gods Only Provided Place Of Worship", "65-1204": "The Rapture", "65-1205": "Things That Are To Be", "65-1206": "Modern Events Are Made Clear By Prophecy", "65-1207": "Leadership", "65-1212": "Communion",}
def clean_title(title): # Remove characters Windows doesn't like title = title.replace("#", "") title = re.sub(r'[<>:"/\\|?*]', '', title) title = re.sub(r"\s+", " ", title).strip() return title
for filename in os.listdir(FOLDER): if not filename.lower().endswith(".pdf"): continue
match = re.search(r"(\d{2}[-_]\d{4}[A-Z]?)", filename) if not match: continue
code = match.group(1).replace("_", "-")
if code not in mapping: print(f"[WARN] No mapping for {code}") continue
title = clean_title(mapping[code]) new_name = f"{code} {title}.pdf"
old_path = os.path.join(FOLDER, filename) new_path = os.path.join(FOLDER, new_name)
os.rename(old_path, new_path) print(f"[OK] {filename} -> {new_name}")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158import osimport reimport timeimport requestsfrom bs4 import BeautifulSoup
# Standardize filenamesdef clean_filename(name): # Keep alphanumeric, spaces, dashes, commas name = re.sub(r'[\\/*?:"<>|]', '', name) # Remove multiple spaces name = re.sub(r'\s+', ' ', name).strip() return name
FOLDER = "./sermons"if not os.path.exists(FOLDER): os.makedirs(FOLDER)
# Get already downloaded reference numbersexisting_refs = set()for filename in os.listdir(FOLDER): if filename.lower().endswith(".pdf"): # Match YY-MMDD[A-Z]? match = re.search(r"^(\d{2}-\d{4}[A-Z]?)", filename) if match: existing_refs.add(match.group(1))
print(f"Loaded {len(existing_refs)} existing sermons from {FOLDER}")
session = requests.Session()headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'Referer': 'https://www.messagehub.info/en/messages.do'}session.headers.update(headers)
# Initialize cookiesprint("Initializing session...")session.get("https://www.messagehub.info/en/messages.do")
# We will scrape all 42 pagestotal_pages = 42downloaded_count = 0
for page in range(1, total_pages + 1): print(f"\n--- Scanning Page {page}/{total_pages} ---") payload = { 'tableCode': 'TranslatedMessages', 'languageId': '53', 'format': 'Book', 'page': str(page) } try: res = session.post("https://www.messagehub.info/en/message_list_records.do", data=payload, timeout=15) if res.status_code != 200: print(f"Error fetching page {page}: Status {res.status_code}") continue except Exception as e: print(f"Exception fetching page {page}: {e}") continue
soup = BeautifulSoup(res.text, 'html.parser') rows = soup.find_all('tr', class_='dataRow') if not rows: print(f"No rows found on page {page}") break
for row in rows: # Extract onclick attributes onclick = row.get('onclick', '') # selectTranslation(this, 160, '53') match_id = re.search(r'selectTranslation\(this,\s*(\d+)', onclick) if not match_id: continue tm_id = match_id.group(1)
cols = row.find_all('td') if len(cols) < 2: continue
ref_num = cols[0].text.strip() title = cols[1].text.strip() # Check if already downloaded if ref_num in existing_refs: # We already have this reference number downloaded continue
print(f"Found missing/new sermon: {ref_num} - {title} (tmId: {tm_id})")
# Fetch the available formats to find the eid for A4 - Full Sheet artifacts_url = f"https://www.messagehub.info/en/message_artifacts.do?tmId={tm_id}&languageId=53&format=Book" try: art_res = session.get(artifacts_url, timeout=10) if art_res.status_code != 200: print(f" Error loading artifacts for {ref_num}") continue except Exception as e: print(f" Exception loading artifacts for {ref_num}: {e}") continue
art_soup = BeautifulSoup(art_res.text, 'html.parser') art_rows = art_soup.find_all('tr', class_='dataRow') eid = None # Look for Full Sheet or A4 format for art_row in art_rows: art_onclick = art_row.get('onclick', '') # downloadMessage('b35428022096ed4e') match_eid = re.search(r"downloadMessage\('([^']+)'\)", art_onclick) if not match_eid: continue caption = art_row.find('td', class_='captionCell') if caption: caption_text = caption.text.lower() # Prioritize full sheet formats if 'full sheet' in caption_text or 'a4' in caption_text: eid = match_eid.group(1) break if not eid and art_rows: # Fallback to the first available format if no specific full sheet is found art_onclick = art_rows[0].get('onclick', '') match_eid = re.search(r"downloadMessage\('([^']+)'\)", art_onclick) if match_eid: eid = match_eid.group(1)
if not eid: print(f" Could not find any download link (eid) for {ref_num}") continue
# Download the message download_url = f"https://www.messagehub.info/download.message?eid={eid}" safe_title = clean_filename(title) filename = f"{ref_num} {safe_title}.pdf" filepath = os.path.join(FOLDER, filename) print(f" Downloading -> {filename} ...") try: dl_res = session.get(download_url, timeout=30) if dl_res.status_code == 200: with open(filepath, 'wb') as f: f.write(dl_res.content) print(f" [OK] Saved to {filepath}") existing_refs.add(ref_num) downloaded_count += 1 else: print(f" Failed to download: Status {dl_res.status_code}") except Exception as e: print(f" Exception downloading {ref_num}: {e}")
# Polite delay to avoid getting banned time.sleep(1.5)
print(f"\nScraping complete! Downloaded {downloaded_count} new/missing sermons.")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158import osimport reimport timeimport requestsfrom bs4 import BeautifulSoup
# Standardize filenamesdef clean_filename(name): # Keep alphanumeric, spaces, dashes, commas name = re.sub(r'[\\/*?:"<>|]', '', name) # Remove multiple spaces name = re.sub(r'\s+', ' ', name).strip() return name
FOLDER = "./sermons_all"if not os.path.exists(FOLDER): os.makedirs(FOLDER)
# Get already downloaded reference numbers in the NEW folder to support resumingexisting_refs = set()for filename in os.listdir(FOLDER): if filename.lower().endswith(".pdf"): # Match everything before the first space parts = filename.split(" ", 1) if len(parts) > 1: existing_refs.add(parts[0])
print(f"Loaded {len(existing_refs)} existing sermons from {FOLDER}")
session = requests.Session()headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'Referer': 'https://www.messagehub.info/en/messages.do'}session.headers.update(headers)
# Initialize cookiesprint("Initializing session...")session.get("https://www.messagehub.info/en/messages.do")
# We will scrape all 42 pagestotal_pages = 42downloaded_count = 0skipped_count = 0
for page in range(1, total_pages + 1): print(f"\n--- Scanning Page {page}/{total_pages} ---") payload = { 'tableCode': 'TranslatedMessages', 'languageId': '53', 'format': 'Book', 'page': str(page) } try: res = session.post("https://www.messagehub.info/en/message_list_records.do", data=payload, timeout=15) if res.status_code != 200: print(f"Error fetching page {page}: Status {res.status_code}") continue except Exception as e: print(f"Exception fetching page {page}: {e}") continue
soup = BeautifulSoup(res.text, 'html.parser') rows = soup.find_all('tr', class_='dataRow') if not rows: print(f"No rows found on page {page}") break
for row in rows: # Extract onclick attributes onclick = row.get('onclick', '') # selectTranslation(this, 160, '53') match_id = re.search(r'selectTranslation\(this,\s*(\d+)', onclick) if not match_id: continue tm_id = match_id.group(1)
cols = row.find_all('td') if len(cols) < 2: continue
ref_num = cols[0].text.strip() title = cols[1].text.strip() # Check if already downloaded in the new folder if ref_num in existing_refs: skipped_count += 1 continue
print(f"[{downloaded_count + 1}] Found sermon to download: {ref_num} - {title} (tmId: {tm_id})")
# Fetch the available formats to find the eid for A4 - Full Sheet artifacts_url = f"https://www.messagehub.info/en/message_artifacts.do?tmId={tm_id}&languageId=53&format=Book" try: art_res = session.get(artifacts_url, timeout=10) if art_res.status_code != 200: print(f" Error loading artifacts for {ref_num}") continue except Exception as e: print(f" Exception loading artifacts for {ref_num}: {e}") continue
art_soup = BeautifulSoup(art_res.text, 'html.parser') art_rows = art_soup.find_all('tr', class_='dataRow') eid = None # Look for Full Sheet or A4 format (excluding Book/Pocket/etc.) for art_row in art_rows: art_onclick = art_row.get('onclick', '') match_eid = re.search(r"downloadMessage\('([^']+)'\)", art_onclick) if not match_eid: continue caption = art_row.find('td', class_='captionCell') if caption: caption_text = caption.text.lower() # Prioritize full sheet formats if 'full sheet' in caption_text or ('a4' in caption_text and 'book' not in caption_text and 'pocket' not in caption_text): eid = match_eid.group(1) break if not eid and art_rows: # Fallback to the first available format if no specific full sheet is found art_onclick = art_rows[0].get('onclick', '') match_eid = re.search(r"downloadMessage\('([^']+)'\)", art_onclick) if match_eid: eid = match_eid.group(1)
if not eid: print(f" Could not find any download link (eid) for {ref_num}") continue
# Download the message download_url = f"https://www.messagehub.info/download.message?eid={eid}" safe_title = clean_filename(title) filename = f"{ref_num} {safe_title}.pdf" filepath = os.path.join(FOLDER, filename) print(f" Downloading -> {filename} ...") try: dl_res = session.get(download_url, timeout=30) if dl_res.status_code == 200: with open(filepath, 'wb') as f: f.write(dl_res.content) print(f" [OK] Saved to {filepath}") existing_refs.add(ref_num) downloaded_count += 1 else: print(f" Failed to download: Status {dl_res.status_code}") except Exception as e: print(f" Exception downloading {ref_num}: {e}")
# Polite delay to avoid getting banned time.sleep(1.0)
print(f"\nScraping complete! Downloaded {downloaded_count} sermons. Skipped {skipped_count} already downloaded.")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Search Sermon Chunks\n", "This notebook allows you to load and search through the parsed sermon chunks. The chunk metadata (like `date_code`) has been corrected and is fully reliable." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import pickle\n", "import re\n", "import pandas as pd\n", "from IPython.display import display, HTML\n", "\n", "# Load the corrected sermon chunks\n", "with open('sermon_chunks.pkl', 'rb') as f:\n", " chunks = pickle.load(f)\n", "\n", "print(f\"Loaded {len(chunks)} sermon chunks.\")\n", "if chunks:\n", " print(f\"Example chunk type: {type(chunks[0])}\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1. General Text Search\n", "Search for a keyword or phrase anywhere in the text." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def search_text(query, chunks, top_k=10, search_metadata=False):\n", " \"\"\"\n", " Search through the chunks for a given text query.\n", " \"\"\"\n", " results = []\n", " query_lower = query.lower()\n", " \n", " for chunk in chunks:\n", " content = chunk.page_content\n", " match_found = query_lower in content.lower()\n", " \n", " if not match_found and search_metadata and hasattr(chunk, 'metadata'):\n", " meta = chunk.metadata\n", " title = str(meta.get('title', '')).lower()\n", " source = str(meta.get('source', '')).lower()\n", " if query_lower in title or query_lower in source:\n", " match_found = True\n", " \n", " if match_found:\n", " content_snippet = content[:300] + '...'\n", " results.append({\n", " 'Title': chunk.metadata.get('title'),\n", " 'Date': chunk.metadata.get('date_code'),\n", " 'Paragraph': chunk.metadata.get('paragraph'),\n", " 'Page Range': f\"{chunk.metadata.get('page_start')} - {chunk.metadata.get('page_end')}\",\n", " 'Snippet': content_snippet\n", " })\n", " \n", " if len(results) >= top_k:\n", " break\n", " \n", " return pd.DataFrame(results)\n", "\n", "# Example usage:\n", "# display(search_text(\"faith\", chunks, top_k=5))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2. Search by Exact Paragraph\n", "Find a specific paragraph using the corrected `date_code` metadata." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def find_paragraph(date_code, paragraph_num, chunks):\n", " \"\"\"\n", " Find a specific paragraph in a specific sermon.\n", " Now relies purely on the corrected `date_code` metadata.\n", " \n", " Args:\n", " date_code (str): The date code of the sermon, e.g., '53-0405S' or '55-0123A'\n", " paragraph_num (str/int): The paragraph number, e.g., '15' or 15\n", " chunks: The loaded list of Document chunks\n", " \"\"\"\n", " results = []\n", " target_date = str(date_code).strip().upper()\n", " target_para = str(paragraph_num).strip()\n", " \n", " for chunk in chunks:\n", " meta = getattr(chunk, 'metadata', {})\n", " \n", " chunk_date = str(meta.get('date_code', '')).strip().upper()\n", " chunk_para = str(meta.get('paragraph', '')).strip()\n", " \n", " # Clean direct match\n", " if chunk_date == target_date and chunk_para == target_para:\n", " results.append({\n", " 'Chunk ID': meta.get('chunk_id'),\n", " 'Date Code': chunk_date,\n", " 'Source': meta.get('source'),\n", " 'Paragraph': chunk_para,\n", " 'Page Range': f\"{meta.get('page_start')} - {meta.get('page_end')}\",\n", " 'Title': meta.get('title'),\n", " 'Content': chunk.page_content\n", " })\n", " \n", " if not results:\n", " print(f\"No results found for Date: {target_date}, Paragraph: {target_para}\")\n", " \n", " return pd.DataFrame(results)\n", "\n", "# --- Example Query ---\n", "target_date = \"55-0123A\"\n", "target_paragraph = \"74\"\n", "\n", "para_df = find_paragraph(target_date, target_paragraph, chunks)\n", "\n", "if not para_df.empty:\n", " print(\"--- FULL PARAGRAPH CONTENT ---\")\n", " print(para_df.iloc[0]['Content'])\n", " print(\"\\n--- METADATA ---\")\n", " display(para_df.drop(columns=['Content']))\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3. Advanced Regex Search\n", "Use regular expressions to find complex patterns." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def regex_search(pattern, chunks, top_k=10, flags=re.IGNORECASE):\n", " \"\"\"\n", " Search through chunks using a Regular Expression pattern.\n", " \"\"\"\n", " results = []\n", " regex = re.compile(pattern, flags)\n", " \n", " for chunk in chunks:\n", " content = chunk.page_content\n", " if regex.search(content):\n", " # Highlight match in snippet (simple truncation for display)\n", " match_idx = content.lower().find(pattern.lower().replace('\\\\b', '')) if not '\\\\' in pattern else 0\n", " start_idx = max(0, match_idx - 50)\n", " snippet = \"...\" + content[start_idx:start_idx + 300].replace('\\n', ' ') + \"...\"\n", " \n", " results.append({\n", " 'Date': chunk.metadata.get('date_code'),\n", " 'Paragraph': chunk.metadata.get('paragraph'),\n", " 'Snippet': snippet\n", " })\n", " if len(results) >= top_k:\n", " break\n", " \n", " return pd.DataFrame(results)\n", "\n", "# Example: find word 'eagle' followed eventually by 'wings'\n", "# display(regex_search(r'eagle.*wings', chunks, top_k=5))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.0" } }, "nbformat": 4, "nbformat_minor": 5}123version https://git-lfs.github.com/spec/v1oid sha256:a5701f3ca7a2758fbae8be07a9a09c8ea264025c74edd319497d7e6aae7887a6size 101995306123version https://git-lfs.github.com/spec/v1oid sha256:d5a411c3924b533dcb4dcf23e04f99d9764dcd74e102294d52bde99ba967f1a0size 101595640
123453 unmodified lines585960616263646566676863 unmodified lines13213313413513613748 unmodified lines1861871881891901911928 unmodified lines20120220320420520621 unmodified lines228229230231232233from collections import defaultdictimport streamlit as st53 unmodified lineselse:st.error(f"Grounding: {status_label}")col1, col2, col3, col4 = st.columns(4)col1.metric("Excerpts", diagnostics.get("source_count", 0))col2.metric("Sermons", diagnostics.get("distinct_sermon_count", 0))col3.metric("Pinecone", diagnostics.get("pinecone_status", "unknown"))col4.metric("Latency", f"{diagnostics.get('total_latency', 0)}s")def render_references(docs):63 unmodified lines)st.markdown("""<style>48 unmodified lines"Answer mode",["Strict Mode", "Study Mode", "Summary Mode"],index=0,help="Strict Mode refuses when retrieved excerpts are not enough.",)sermon_scope = st.text_input(8 unmodified lines"Seven Seals": "what are the seven seals? list each seal and state its events and meaning","Seven Thunders": "what are the seven thunders?","Serpent's Seed": "What is the relationship between the Serpent's Seed and Cain?","Church Ages": "Summarize the seven church ages.",}for label, prompt_text in topic_prompts.items():21 unmodified linesst.markdown(msg["content"], unsafe_allow_html=False)if msg["role"] == "assistant":render_assistant_metadata(msg)st.markdown("""123456753 unmodified lines61626364656667686970717263 unmodified lines13613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117248 unmodified lines2212222232242252262272282292308 unmodified lines23924024124224324424524621 unmodified lines268269270271272273274275276277278279280281282283284285286287288289290from collections import defaultdictimport jsonimport osimport timeimport streamlit as st53 unmodified lineselse:st.error(f"Grounding: {status_label}")col1, col2, col3, col4, col5 = st.columns(5)col1.metric("Excerpts", diagnostics.get("source_count", 0))col2.metric("Sermons", diagnostics.get("distinct_sermon_count", 0))col3.metric("Pinecone", diagnostics.get("pinecone_status", "unknown"))col4.metric("Latency", f"{diagnostics.get('total_latency', 0)}s")col5.metric("Model", diagnostics.get("llm_model", "unknown"))def render_references(docs):63 unmodified lines)def log_feedback(msg: dict, rating: str):feedback_file = "feedback_log.json"log_entry = {"timestamp": time.strftime("%Y-%m-%d %H:%M:%S"),"answer": msg.get("content", ""),"sources": [{"source": doc.metadata.get("source", ""),"paragraph": doc.metadata.get("paragraph", ""),"content": doc.page_content[:300] + "..."}for doc in msg.get("sources", [])],"diagnostics": msg.get("diagnostics", {}),"grounding_status": msg.get("grounding_status", "unknown"),"rating": rating}logs = []if os.path.exists(feedback_file):try:with open(feedback_file, "r", encoding="utf-8") as f:logs = json.load(f)except Exception:passlogs.append(log_entry)with open(feedback_file, "w", encoding="utf-8") as f:json.dump(logs, f, indent=4)st.markdown("""<style>48 unmodified lines"Answer mode",["Strict Mode", "Study Mode", "Summary Mode"],index=0,help=("Strict sends the best 8 excerpts. Study sends up to 14. ""Summary sends up to 20 and spreads sermon summaries across the source."),)sermon_scope = st.text_input(8 unmodified lines"Seven Seals": "what are the seven seals? list each seal and state its events and meaning","Seven Thunders": "what are the seven thunders?","Serpent's Seed": "What is the relationship between the Serpent's Seed and Cain?","Adoption": "Summarize the Adoption series.","Demonology": "Summarize the Demonology series.","Church Ages": "Summarize the seven church ages.",}for label, prompt_text in topic_prompts.items():21 unmodified linesst.markdown(msg["content"], unsafe_allow_html=False)if msg["role"] == "assistant":render_assistant_metadata(msg)# Render thumbs up / thumbs down feedback buttons for evaluating the responsemsg_idx = st.session_state.chat_history.index(msg)if f"feedback_{msg_idx}" not in st.session_state:st.session_state[f"feedback_{msg_idx}"] = Nonecol1, col2, _ = st.columns([1, 1, 15])with col1:if st.button("👍", key=f"thumbs_up_{msg_idx}", help="Accurate, helpful, and properly grounded"):st.session_state[f"feedback_{msg_idx}"] = "thumbs_up"log_feedback(msg, "thumbs_up")st.toast("Response marked as helpful! Thanks.", icon="👍")with col2:if st.button("👎", key=f"thumbs_down_{msg_idx}", help="Inaccurate or poorly grounded"):st.session_state[f"feedback_{msg_idx}"] = "thumbs_down"log_feedback(msg, "thumbs_down")st.toast("Issue logged. We will review the grounding!", icon="👎")st.markdown("""
123456789101112131415161718192021222324252627282930from selenium import webdriverfrom selenium.webdriver.chrome.options import Optionsfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECimport time
options = Options()options.add_argument('--headless')driver = webdriver.Chrome(options=options)driver.get('https://www.messagehub.info/en/messages.do')
# Wait for rowsWebDriverWait(driver, 10).until( EC.presence_of_element_located((By.CSS_SELECTOR, '.dataRow')))
# Click first rowrow = driver.find_element(By.CSS_SELECTOR, '.dataRow')row.click()print("Clicked row")
# Wait for formats pane to updatetime.sleep(3)
# Dump right pane HTMLright_pane = driver.find_element(By.ID, 'artifactList')print(right_pane.get_attribute('outerHTML'))
driver.quit()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144import osimport timeimport sysimport jsonimport dotenv
from pinecone import Pineconefrom app import load_chunks, get_vector_store
# Load environment variablesdotenv.load_dotenv()
CHECKPOINT_FILE = "upload_checkpoint.json"
BATCH_SIZE = 64 # Optimally sized for high-precision paragraph chunks (averaging ~230 tokens each)SLEEP_BETWEEN_BATCHES = 0.2 # Throttling is now managed by the high-speed Google Gemini APIMAX_RETRIES = 5BACKOFF_FACTOR = 2
def clear_index(): api_key = os.getenv("PINECONE_API_KEY") if not api_key: print("Error: PINECONE_API_KEY is not set.") sys.exit(1) pc = Pinecone(api_key=api_key) index_name = "branham-index" print(f"Connecting to Pinecone index '{index_name}'...") idx = pc.Index(index_name) stats = idx.describe_index_stats() total_vectors = stats.get("total_vector_count", 0) print(f"Current total vector count before clear: {total_vectors}") print(f"Deleting all vectors in '{index_name}' to start fresh...") try: idx.delete(delete_all=True) except Exception as e: print(f"Index deletion skipped (it might already be completely empty): {e}") # Wait for deletion to reflect time.sleep(5) stats = idx.describe_index_stats() print(f"Post-clear total vector count: {stats.get('total_vector_count', 0)}") print("Pinecone index cleared successfully!\n")
def upload_in_batches(chunks, start_idx=0): # Model is loaded inside get_vector_store(), track the exact loading time print("Initializing embedding model and Pinecone connection...") model_load_start = time.perf_counter() vector_store = get_vector_store() print(f"Initialization complete in {time.perf_counter() - model_load_start:.1f}s.\n") total_chunks = len(chunks) print(f"Starting batch upload of {total_chunks} chunks to Pinecone...") print(f"Batch Size: {BATCH_SIZE} | Spacer delay: {SLEEP_BETWEEN_BATCHES}s | Max Retries: {MAX_RETRIES}\n") # Track elapsed time strictly for encoding + uploading start_time = time.perf_counter() for i in range(start_idx, total_chunks, BATCH_SIZE): batch = chunks[i : i + BATCH_SIZE] batch_num = (i // BATCH_SIZE) + 1 total_batches = (total_chunks + BATCH_SIZE - 1) // BATCH_SIZE # Implement robust retry with exponential backoff retries = 0 while retries <= MAX_RETRIES: try: # Add to Pinecone vector_store.add_documents(batch) # Progress logging elapsed = time.perf_counter() - start_time pct = (min(i + BATCH_SIZE, total_chunks) / total_chunks) * 100 rate = (i + len(batch) - start_idx) / elapsed if elapsed > 0 else 0 eta = (total_chunks - (i + len(batch))) / rate if rate > 0 else 0 print( f"[{pct:6.2f}%] Batch {batch_num}/{total_batches} uploaded successfully. " f"({min(i + BATCH_SIZE, total_chunks)}/{total_chunks}) | " f"Speed: {rate:.1f} chunks/sec | ETA: {eta/60:.1f} min" ) # Write checkpoint to file with open(CHECKPOINT_FILE, "w", encoding="utf-8") as f: json.dump({"last_uploaded_index": i + len(batch)}, f) break except Exception as e: retries += 1 if retries > MAX_RETRIES: print(f"\n[FATAL ERROR] Batch {batch_num} failed completely after {MAX_RETRIES} retries. Error: {e}") raise e sleep_time = BACKOFF_FACTOR ** retries print( f"\n[WARNING] Error on Batch {batch_num} (Attempt {retries}/{MAX_RETRIES}): {e}. " f"Retrying in {sleep_time}s..." ) time.sleep(sleep_time) time.sleep(SLEEP_BETWEEN_BATCHES) total_time = time.perf_counter() - start_time print(f"\nSUCCESS! Uploaded {total_chunks} chunks to Pinecone in {total_time/60:.2f} minutes.") # Delete checkpoint on success if os.path.exists(CHECKPOINT_FILE): os.remove(CHECKPOINT_FILE)
def main(): # 1. Load the clean serialized chunks print("Loading chunks from 'sermon_chunks.pkl'...") chunks = load_chunks() if not chunks: print("Error: No chunks found in 'sermon_chunks.pkl'. Make sure chunking is complete.") return print(f"Successfully loaded {len(chunks)} sermon chunks.\n") # 2. Check for checkpoint to see if we can resume start_idx = 0 if os.path.exists(CHECKPOINT_FILE): try: with open(CHECKPOINT_FILE, "r", encoding="utf-8") as f: data = json.load(f) start_idx = data.get("last_uploaded_index", 0) except Exception as e: print(f"[WARNING] Could not read checkpoint file: {e}. Starting fresh.") if start_idx > 0 and start_idx < len(chunks): print(f"[RESUME] Checkpoint found! Resuming upload from chunk index {start_idx}...") else: # 3. Clear index only when starting fresh print("[START FRESH] Starting fresh. Clearing index first...") clear_index() # 4. Upload chunks upload_in_batches(chunks, start_idx=start_idx)
if __name__ == "__main__": main().env.exampleAdded+6
.gitignore+10-1
.streamlit/config.tomlAdded+2
src/app.py+228-55
src/chunk_sermons.pyAdded+314
src/colab_uploader.pyAdded+161
src/evaluate_rag.pyAdded+240
src/fix_chunks.pyAdded+59
src/functions.jsAdded+876
src/messagehub.jsAdded+213
src/messages.htmlAdded+359
src/messages_list.htmlAdded+17
src/records.htmlAdded+391
src/rename_files.pyAdded+1258
src/scrape_all_pdfs.pyAdded+158
src/scrape_everything.pyAdded+158
src/search_chunks.ipynbAdded+211
src/sermon_chunks.pkl+2-2
src/streamlit_app.py+59-2
src/test_sel.pyAdded+30
src/upload_to_pinecone.pyAdded+144