# Mizan: Compare two words or phrases

**Compare** (`compare.html`, *muqāranah*) sets two Arabic words or phrases side by side: how often each appears, where, whether they appear together, and what that does and does not mean. Its address holds every setting, so **a copied link reproduces exactly what you saw**. See [Sharing](#sharing).

Open it at [/numerical_analysis/compare.html](/numerical_analysis/compare.html), or with an example already filled in: [نُور ↔ ظُلُمَٰت](/numerical_analysis/compare.html?p1=%D9%86%D9%8F%D9%88%D8%B1&p2=%D8%B8%D9%8F%D9%84%D9%8F%D9%85%D9%8E%D9%B0%D8%AA).

## Overview
Top to bottom the page has the **inputs**, a **status** line, two **side headings** with counts, an **insight** sentence, the **charts**, the **reading panel**, the **per-surah table** and the **counting rules**.

## Inputs
1. In **First word or phrase** type Arabic. A phrase matches the words in order with none between.
2. In **Second word or phrase** type the other side. **⇄** swaps the two.
3. Choose **Match mode**: *auto* (for a single word, its word family), *exact* or *normalized* (the bare surface form). See [Matching](/docs/34-mizan-counting-rules#matching).
4. Click **Compare**. *The page fills in below; prompts and errors appear in the status line under the buttons.*

### Examples
Chips under the inputs fill both boxes: *نُور ↔ ظُلُمَٰت*, *ٱلرَّحْمَٰن ↔ ٱلرَّحِيم*, *فِي سَبِيلِ ٱللَّهِ ↔ ٱلْحَمْدُ لِلَّهِ*.

## Summary
The two side headings give each side's headline counts: occurrences, the number of surahs and the first and last place it appears.

## Insight
A plain-language line, "Reading the comparison …", states what the pair shows: for example which word is more spread out, and whether they co-occur more or less than chance. It is a reading of the numbers, not an interpretation of meaning.

## Charts
Five charts, each in a card with a **Link** button and view toggles. Chart ids (used in links): `surah-chart`, `timeline`, `gaps`, `surah-3d`, `quran-map`.

### Per-surah chart
Occurrences per surah for both sides.

### Corpus timeline
Where the words fall along the whole text, in order. The *per occurrence* toggle measures per occurrence instead of per surah.

### Gaps between occurrences
Distances between successive appearances: evenly spread words have small, regular gaps; clustered words have a few large ones.

### Per-surah occurrences in 3D
A rotatable version of the per-surah chart. Drag to rotate.

### Whole-Quran even–odd circle
All 6,236 verses on one circle with your matches marked.

- The toolbar has **◀ match** and **match ▶** to jump between matches, **+**, **−** and **Fit all** to zoom, **Save PNG**, **Key** and **? How to read this**.
- **Go to** zooms to a verse (`2:255`), a surah (`18`) or a ring number (`#3000`).
- Sliders: **Zoom**, **Surah gap**, **Background**; selects **Detail** and **Colour**.

## Reading panel
Three tabs let you read what you matched, in context:

- **About**: *Spellings found*, *Same root, other forms* (tap one to compare with that form instead), *Often in the same verse* and **Read the first match →**.
- **Verse**: the verse being read.
- **Matches**: every match with its verse.

## Per-surah table
**Per-surah table** holds the data behind the charts. **CSV** and **JSON** buttons download it.

## Counting rules

At the bottom, **Counting rules (stated by the engine, verbatim)** shows the exact rules used for this comparison. See [Counting rules](/docs/34-mizan-counting-rules#principles).

## Sharing
The address bar is the state. Every option you set is written into the query string as you go; nothing is stored on the server.

| Parameter | Meaning |
|---|---|
| `p1`, `p2` | The first and second word or phrase (URL-encoded Arabic). |
| `mode` | Match mode: `auto` (default), `exact` or `normalized`. |
| `section` | Which section a link scrolls to and highlights: `summary`, `insight`, `surah-chart`, `timeline`, `gaps`, `surah-3d`, `quran-map`, `table` or `rules`. |
| `rtab`, `rf`, `rwbw`, `rfull` | The reading panel's tab and options. |
| `measure`, `shape`, `color`, `detail`, `num`, `split` | Chart display options. |
| `zi`, `zr`, `sx`, `sy`, `ss`, `gap`, `bg`, `mod` | Circle zoom, position and sliders. |
| `key`, `labels`, `rules` | Whether the key, labels and rules are open. |

Parameters at their default are left out to keep links short.

### Copy a link to one section

1. Run a comparison.
2. Find the **Link** button in the corner of a section (**Copy link to this section**).
3. Click it. *The full link is copied, with `section=<id>` added, and "Link copied" confirms it.* If your browser blocks the clipboard, a prompt shows the link to copy by hand.

When someone opens such a link, the page re-runs the comparison, scrolls to the section and highlights it.

### Links for people who are signed out

A link to Compare needs a sign-in. Someone who is signed out is taken to the landing page (its address carries the original link as `?next=`) and, after signing in or [registering](/docs/20-getting-started#sign-up), is brought back to the *same* link with every parameter intact. You can therefore paste a Compare link into a message to a colleague without worrying about whether they have an account yet.
